From: Eric Bollengier Date: Tue, 28 Aug 2012 09:39:12 +0000 (+0200) Subject: Avoid problem when stripping a relative path X-Git-Tag: Release-7.0.0~96 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=204a106d7f4adeb2c96464a05ff8b0a0cb6c02ef;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