From: Wayne Davison Date: Thu, 11 Sep 2003 03:49:53 +0000 (+0000) Subject: Make sure that the new slash-stripping P_PATH code doesn't turn X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/15089022d43b337f2de73e96f1991606dc80bce5 Make sure that the new slash-stripping P_PATH code doesn't turn a "/" into an empty string. --- diff --git a/loadparm.c b/loadparm.c index 3dcfc4fe..9dc80e70 100644 --- a/loadparm.c +++ b/loadparm.c @@ -665,8 +665,8 @@ static BOOL lp_do_parameter(int snum, char *parmname, char *parmvalue) string_set(parm_ptr,parmvalue); if ((cp = *(char**)parm_ptr) != NULL) { int len = strlen(cp); - while (len && cp[--len] == '/') - cp[len] = '\0'; + while (len > 1 && cp[len-1] == '/') len--; + cp[len] = '\0'; } break;