strip any leading / off absolute paths when using relative path names
authorAndrew Tridgell <tridge@samba.org>
Mon, 18 May 1998 14:11:43 +0000 (14:11 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 18 May 1998 14:11:43 +0000 (14:11 +0000)
flist.c

diff --git a/flist.c b/flist.c
index cf40151..d3c07ed 100644 (file)
--- a/flist.c
+++ b/flist.c
@@ -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;