summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index df1880eec4..bd9ea02a50 100644
--- a/dir.c
+++ b/dir.c
@@ -1263,7 +1263,7 @@ glob_helper(path, dirsep, exist, isdir, beg, end, flags, func, arg)
if (magical || recursive) {
struct dirent *dp;
- DIR *dirp = do_opendir(path);
+ DIR *dirp = do_opendir(*path ? path : ".");
if (dirp == NULL) return 0;
for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) {