]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/filed/backup.c
Avoid problem when stripping a relative path
[bacula/bacula] / bacula / src / filed / backup.c
index 44d7e29d5c773d2b5c200cb5c98cca586d33bf1f..3a42799eb969c8a0e0e83ab685edb789adabe557 100644 (file)
@@ -1440,8 +1440,10 @@ static bool do_strip(int count, char *in)
    while (*in && !IsPathSeparator(*in)) {    
       out++; in++;
    }
-   out++; in++;
-   numsep++;                     /* one separator seen */
+   if (*in) {                    /* Not at the end of the string */
+      out++; in++;
+      numsep++;                  /* one separator seen */
+   }
    for (stripped=0; stripped<count && *in; stripped++) {
       while (*in && !IsPathSeparator(*in)) {
          in++;                   /* skip chars */