summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortsi <tsi>2007-09-16 01:42:17 +0000
committertsi <tsi>2007-09-16 01:42:17 +0000
commit4c1fdcffd401ccd68a51bee568273712489c9884 (patch)
treecb37cff9d2bf3b1cd3bd46eecbef2729ba3d14cc
parent0b61460a62f750ff555930995b748cfbd267a88e (diff)
3. Change `lndir` utility to trim off trailing self-references (i.e. "/" and
"/." from its "from" argument (Marc La France).
-rw-r--r--config/util/lndir.c17
-rw-r--r--programs/Xserver/hw/xfree86/CHANGELOG4
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 $