From 0282e6281e02a1e68ddc20f8b7083d80b7a8e54f Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Tue, 30 Oct 2018 16:10:49 +0900 Subject: [PATCH] esh: fix globbing of .* --- apps/sh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/sh.c b/apps/sh.c index 033532fb..fd03e00c 100644 --- a/apps/sh.c +++ b/apps/sh.c @@ -1183,7 +1183,7 @@ _done: if (dirp) { struct dirent * ent = readdir(dirp); while (ent != NULL) { - if (ent->d_name[0] != '.') { + if (ent->d_name[0] != '.' || (dir ? (dir[1] == '.') : (before && before[0] == '.'))) { char * s = malloc(sizeof(char) * (strlen(ent->d_name) + 1)); memcpy(s, ent->d_name, strlen(ent->d_name) + 1);