diff options
| author | Ruslan Ermilov <ru@FreeBSD.org> | 2003-10-02 21:30:30 +0000 |
|---|---|---|
| committer | Ruslan Ermilov <ru@FreeBSD.org> | 2003-10-02 21:30:30 +0000 |
| commit | 21159d1687baa5f8c04b44ded49de89647190090 (patch) | |
| tree | ce7b4dd061a28517eb5677f21263ba45f59ffd29 /usr.bin | |
| parent | 833d1871ba8b2b09133540bcb2f10a6cc1c35cfd (diff) | |
Notes
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/make/dir.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c index 57d168799b27..137a21e32cdf 100644 --- a/usr.bin/make/dir.c +++ b/usr.bin/make/dir.c @@ -680,7 +680,7 @@ Dir_FindFile (char *name, Lst path) LstNode ln; /* a list element */ char *file; /* the current filename to check */ Path *p; /* current path member */ - char *cp; /* index of first slash, if any */ + char *cp; /* final component of the name */ Boolean hasSlash; /* true if 'name' contains a / */ struct stat stb; /* Buffer for stat, if necessary */ Hash_Entry *entry; /* Entry for mtimes table */ @@ -767,9 +767,14 @@ Dir_FindFile (char *name, Lst path) continue; } if (*p1 == '\0' && p2 == cp - 1) { - DEBUGF(DIR, ("must be here but isn't -- returing NULL\n")); Lst_Close (path); - return ((char *) NULL); + if (*cp == '\0' || ISDOT(cp) || ISDOTDOT(cp)) { + DEBUGF(DIR, ("returning %s\n", name)); + return (estrdup(name)); + } else { + DEBUGF(DIR, ("must be here but isn't -- returning NULL\n")); + return ((char *) NULL); + } } } } |
