From 4c1fdcffd401ccd68a51bee568273712489c9884 Mon Sep 17 00:00:00 2001 From: tsi Date: Sun, 16 Sep 2007 01:42:17 +0000 Subject: 3. Change `lndir` utility to trim off trailing self-references (i.e. "/" and "/." from its "from" argument (Marc La France). --- config/util/lndir.c | 17 ++++++++++++----- programs/Xserver/hw/xfree86/CHANGELOG | 4 +++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/config/util/lndir.c b/config/util/lndir.c index ec2131173..008c32867 100644 --- a/config/util/lndir.c +++ b/config/util/lndir.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/config/util/lndir.c,v 3.25tsi Exp $ */ +/* $XFree86: xc/config/util/lndir.c,v 3.26tsi Exp $ */ /* Create shadow link tree (after X11R4 script of the same name) Mark Reinhold (mbr@lcs.mit.edu)/3 January 1990 */ @@ -525,7 +525,7 @@ main (int ac, char *av[]) char *prog_name = av[0]; char *fn = NULL, *tn; struct stat fs, ts; - int ret = 0; + int ret = 0, len; while (++av, --ac) { if ((strcmp(*av, "-silent") == 0) || @@ -592,8 +592,8 @@ main (int ac, char *av[]) if (clean_only) { if (cleandir(tn) == -1) - exit(1); - exit(0); + return 1; + return 0; } /* from directory */ @@ -606,11 +606,18 @@ main (int ac, char *av[]) #endif quit (2, "%s: Not a directory", fn); + /* Strip off from directory's trailing self references */ + len = strlen(fn); + while ((--len > 1) && + ((fn[len] == '/') || + ((fn[len] == '.') && (fn[len - 1] == '/')))) + fn[len] = '\0'; + ret = dodir (fn, &fs, &ts, 0); if (ret == 0 && clean) if (cleandir(tn) < 0) ret = 1; - exit(ret); + return ret; } diff --git a/programs/Xserver/hw/xfree86/CHANGELOG b/programs/Xserver/hw/xfree86/CHANGELOG index 53b61561e..2f1c80529 100644 --- a/programs/Xserver/hw/xfree86/CHANGELOG +++ b/programs/Xserver/hw/xfree86/CHANGELOG @@ -1,4 +1,6 @@ XFree86 4.7.99.2 (?? September 2007) + 3. Change `lndir` utility to trim off trailing self-references (i.e. "/" and + "/." from its "from" argument (Marc La France). 2. On SVR4 variants (including SunOS & Solaris), use the `make` implementation found in $PATH, instead of a hard-wired one (Marc La France). @@ -20600,4 +20602,4 @@ XFree86 3.0a (28 April 1994) XFree86 3.0 (26 April 1994) -$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG,v 3.3906 2007/09/16 00:14:40 tsi Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG,v 3.3907 2007/09/16 01:37:26 tsi Exp $ -- cgit v1.2.3