]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Make sure that the new slash-stripping P_PATH code doesn't turn
authorWayne Davison <wayned@samba.org>
Thu, 11 Sep 2003 03:49:53 +0000 (03:49 +0000)
committerWayne Davison <wayned@samba.org>
Thu, 11 Sep 2003 03:49:53 +0000 (03:49 +0000)
a "/" into an empty string.

loadparm.c

index 3dcfc4fe4fabf4a8ee35e7837c6056d8b6f3fdf9..9dc80e70988d031e1b33944d3d2a8cfc683e5052 100644 (file)
@@ -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;