diff options
author | Aron Griffis <agriffis@gentoo.org> | 2004-04-05 04:20:55 +0000 |
---|---|---|
committer | Aron Griffis <agriffis@gentoo.org> | 2004-04-05 04:20:55 +0000 |
commit | 405916a8c46cf7bbf955f2f04e06f696a320aa8e (patch) | |
tree | 2224bcb5ab290e4fd6cbafbf328ea4558513d822 /sys-devel/pmake/files/skipdots.patch | |
parent | Phoenix down on 3.2-r2 to fix clean up mistake. :( (diff) | |
download | historical-405916a8c46cf7bbf955f2f04e06f696a320aa8e.tar.gz historical-405916a8c46cf7bbf955f2f04e06f696a320aa8e.tar.bz2 historical-405916a8c46cf7bbf955f2f04e06f696a320aa8e.zip |
Don't assume that . and .. are the first two entries returned by readdir. Thanks to Bob Miller in bug 45998 for the patch
Diffstat (limited to 'sys-devel/pmake/files/skipdots.patch')
-rw-r--r-- | sys-devel/pmake/files/skipdots.patch | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sys-devel/pmake/files/skipdots.patch b/sys-devel/pmake/files/skipdots.patch new file mode 100644 index 000000000000..0bf81a9eeb7e --- /dev/null +++ b/sys-devel/pmake/files/skipdots.patch @@ -0,0 +1,22 @@ +--- pmake-1.45.orig/dir.c 1997-09-28 04:46:39.000000000 -0700 ++++ pmake-1.45/dir.c 2004-03-28 07:03:27.000000000 -0800 +@@ -1170,13 +1170,13 @@ + p->refCount = 1; + Hash_InitTable (&p->files, -1); + +- /* +- * Skip the first two entries -- these will *always* be . and .. +- */ +- (void)readdir(d); +- (void)readdir(d); +- + while ((dp = readdir (d)) != (struct dirent *) NULL) { ++ /* ++ * Skip "." and ".." ++ */ ++ if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) { ++ continue; ++ } + #if defined(sun) && defined(d_ino) /* d_ino is a sunos4 #define for d_fileno */ + /* + * The sun directory library doesn't check for a 0 inode |