Permalink
Browse files

mirror: don't remove src dir if it ends with a slash (fix #233)

  • Loading branch information...
lavv17 committed May 10, 2016
1 parent eabe60d commit ad49e07df28aeb3c5074640ece8fb67eafd9bdbc
Showing with 2 additions and 1 deletion.
  1. +1 −1 src/MirrorJob.cc
  2. +1 −0 src/xstring.h
View
@@ -1215,7 +1215,7 @@ int MirrorJob::Do()
break;
// all jobs finished.
if(remove_source_dirs) {
if(remove_source_dirs && source_dir.last_char()!='/') {
// remove source directory once.
remove_source_dirs=false;
if(script)
View
@@ -145,6 +145,7 @@ class xstring_c : public xstring0
bool eq_nc(const char *s) const { return !xstrcasecmp(buf,s); }
size_t length() const { return xstrlen(buf); }
void set_length(size_t n) { if(buf) buf[n]=0; }
char last_char() const { size_t len=length(); return len>0?buf[len-1]:0; }
void unset() { xfree(buf); buf=0; }
void _set(const char *s) { buf=xstrdup(s); }

0 comments on commit ad49e07

Please sign in to comment.