isync

mailbox synchronization program
git clone https://git.code.sf.net/p/isync/isync
Log | Files | Refs | README | LICENSE

commit 7ff8eef06c0796fb0b9ac2f9d9720683640e0191
parent 2e8181a8d80c1d0d04a2bc77bf732d6c0b310703
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Mon, 26 Apr 2004 14:09:46 +0000

strip $HOME and ~ from Mailbox paths

Diffstat:
Msrc/compat/config.c | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/compat/config.c b/src/compat/config.c @@ -119,6 +119,13 @@ load_config( const char *path, config_t ***stor ) cfg = **stor = nfmalloc( sizeof(config_t) ); *stor = &cfg->next; memcpy( cfg, &global, sizeof(config_t) ); + if (val[0] == '~' && val[1] == '/') + val += 2; + else { + int l = strlen( Home ); + if (!memcmp( val, Home, l ) && val[l] == '/') + val += l + 1; + } /* not expanded at this point */ cfg->path = nfstrdup( val ); } else if (!strcasecmp( "OneToOne", cmd )) {