6 Oct 2011 07:58
Re: mirror to custom dir?
Alexander V. Lukyanov <lav <at> netis.ru>
2011-10-06 05:58:37 GMT
2011-10-06 05:58:37 GMT
On Fri, Sep 30, 2011 at 02:06:42PM +0200, Niklas Janzon wrote: > To clear, if I doing as explained here, it will make a dir namned > /test/dir/ftp:home/ and put all files inside that. :/ Please test this patch. -- Alexander.
diff --git a/src/MirrorJob.cc b/src/MirrorJob.cc
index 51bd2c8..4b945d6 100644
--- a/src/MirrorJob.cc
+++ b/src/MirrorJob.cc
<at> <at> -1656,8 +1656,10 <at> <at> CMD(mirror)
{
// user wants source dir name appended.
const char *base=basename_ptr(source_dir);
- if(base[0]!='/' && strcmp(base,basename_ptr(arg)))
+ if(base[0]!='/' && strcmp(base,basename_ptr(arg))) {
target_dir=xstring::cat(target_dir,base,NULL);
+ target_dir=alloca_strdup(target_dir); // save the buffer
+ }
}
}
else
<at> <at> -1665,8 +1667,10 <at> <at> CMD(mirror)
target_dir=basename_ptr(source_dir);
if(target_dir[0]=='/')
target_dir=".";
(Continue reading)
RSS Feed