Module Name: src Committed By: sjg Date: Sat Mar 5 23:57:05 UTC 2011
Modified Files: src/usr.bin/make: dir.c Log Message: Treat some/dir/ the same as some/dir/. To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 src/usr.bin/make/dir.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/make/dir.c diff -u src/usr.bin/make/dir.c:1.62 src/usr.bin/make/dir.c:1.63 --- src/usr.bin/make/dir.c:1.62 Sat Nov 27 05:02:35 2010 +++ src/usr.bin/make/dir.c Sat Mar 5 23:57:05 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.62 2010/11/27 05:02:35 sjg Exp $ */ +/* $NetBSD: dir.c,v 1.63 2011/03/05 23:57:05 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: dir.c,v 1.62 2010/11/27 05:02:35 sjg Exp $"; +static char rcsid[] = "$NetBSD: dir.c,v 1.63 2011/03/05 23:57:05 sjg Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: dir.c,v 1.62 2010/11/27 05:02:35 sjg Exp $"); +__RCSID("$NetBSD: dir.c,v 1.63 2011/03/05 23:57:05 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -1061,6 +1061,7 @@ Boolean hasSlash; /* true if 'name' contains a / */ struct stat stb; /* Buffer for stat, if necessary */ Hash_Entry *entry; /* Entry for mtimes table */ + const char *trailing_dot = "."; /* * Find the final component of the name and note whether it has a @@ -1165,6 +1166,11 @@ return NULL; } + if (*cp == '\0') { + /* we were given a trailing "/" */ + cp = trailing_dot; + } + if (name[0] != '/') { Boolean checkedDot = FALSE; @@ -1272,6 +1278,10 @@ * b/c we added it here. This is not good... */ #ifdef notdef + if (cp == traling_dot) { + cp = strrchr(name, '/'); + cp += 1; + } cp[-1] = '\0'; (void)Dir_AddDir(path, name); cp[-1] = '/';