From: Eric Bollengier Date: Tue, 28 Aug 2012 09:39:12 +0000 (+0200) Subject: Avoid problem when stripping a relative path X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3aa456772d9569f5edc9ba5acfacc11e65908c9b;p=bacula%2Fbacula Avoid problem when stripping a relative path --- diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index 44d7e29d5c..3a42799eb9 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -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