mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-10-20 21:04:15 -04:00
strip any leading / off absolute paths when using relative path names
This commit is contained in:
1 parent
ba5e128d23
commit
130b4ae447
1 file changed
+6
@@ -262,6 +262,12 @@ static void receive_file_entry(struct file_struct **fptr,
|
||||
|
||||
clean_fname(thisname);
|
||||
|
||||
if (relative_paths && thisname[0] == '/') {
|
||||
/* strip / off absolute paths in destination */
|
||||
memmove(thisname, thisname+1, strlen(thisname));
|
||||
if (!thisname[0]) strcpy(thisname,".");
|
||||
}
|
||||
|
||||
if ((p = strrchr(thisname,'/'))) {
|
||||
static char *lastdir;
|
||||
*p = 0;
|
||||
|
||||
Reference in new issue
Block a user