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-Tag: v2.5.7~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15089022d43b337f2de73e96f1991606dc80bce5;p=thirdparty%2Frsync.git 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;