From cef45cd543c1c8ac2da327803ac878a87435329f Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Fri, 3 Sep 1999 15:56:04 +0000 Subject: zsh-workers/7639 --- Src/glob.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Src/glob.c') diff --git a/Src/glob.c b/Src/glob.c index 68cd81b01..cbfd699c2 100644 --- a/Src/glob.c +++ b/Src/glob.c @@ -243,7 +243,11 @@ statfullpath(const char *s, struct stat *st, int l) "BUG: statfullpath(): pathname too long"); strcpy(buf, pathbuf + pathbufcwd); strcpy(buf + pathpos - pathbufcwd, s); - if (!*s) { + if (!*s && *buf) { + /* + * Don't add the '.' if the path so far is empty, since + * then we get bogus empty strings inserted as files. + */ buf[pathpos - pathbufcwd] = '.'; buf[pathpos - pathbufcwd + 1] = '\0'; l = 0; -- cgit 1.4.1