about summary refs log tree commit diff
path: root/Src/glob.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-03 15:56:04 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-03 15:56:04 +0000
commitcef45cd543c1c8ac2da327803ac878a87435329f (patch)
tree6d1a8fa46efe6ab9e4f5876a79f13e5e4998f6c7 /Src/glob.c
parent051884d7fd21e87ee1f3d5305ac76c81102853ab (diff)
downloadzsh-cef45cd543c1c8ac2da327803ac878a87435329f.tar.gz
zsh-cef45cd543c1c8ac2da327803ac878a87435329f.tar.xz
zsh-cef45cd543c1c8ac2da327803ac878a87435329f.zip
zsh-workers/7639
Diffstat (limited to 'Src/glob.c')
-rw-r--r--Src/glob.c6
1 files changed, 5 insertions, 1 deletions
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;