From 130b4ae4475ec2458e8d33d192e95f52718829be Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 18 May 1998 14:11:43 +0000 Subject: [PATCH] strip any leading / off absolute paths when using relative path names --- flist.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flist.c b/flist.c index cf401519..d3c07edc 100644 --- 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; -- 2.34.1