From d1f1f7375a2077493b5b4013c4fffb4fa78f9fa7 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 28 Jun 1996 21:13:32 +0000 Subject: [PATCH] strip out duplicate '/' in filenames CVS patchset: 706 CVS date: 1996/06/28 21:13:32 --- build/files.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/build/files.c b/build/files.c index 79ff8be..4171106 100644 --- a/build/files.c +++ b/build/files.c @@ -470,6 +470,8 @@ static int add_file(struct file_entry **festack, const char *name, char *Pmode, char *Uname, char *Gname) { struct file_entry *p; + char *copyTo, copied; + const char *copyFrom; char fullname[1024]; int mode; @@ -483,7 +485,18 @@ static int add_file(struct file_entry **festack, const char *name, GGname = Gname; p = malloc(sizeof(struct file_entry)); - strcpy(p->file, name); + + copyTo = p->file; + copied = '\0'; + copyFrom = name; + while (*copyFrom) { + if (*copyFrom != '/' || copied != '/') { + *copyTo++ = copied = *copyFrom; + } + copyFrom++; + } + *copyTo = '\0'; + p->isdoc = isdoc; p->isconf = isconf; p->verify_flags = verify_flags; -- 2.7.4