From e34a3ca78f0f39ec2cc93e17ebfa36d7e630bfdc Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 4 Oct 2022 21:06:23 -0400 Subject: [PATCH] Stealthy fix of list_dir on windows with single letter directories. --- src/api/system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/system.c b/src/api/system.c index a4f7bbc..052d15f 100644 --- a/src/api/system.c +++ b/src/api/system.c @@ -515,7 +515,7 @@ static int f_list_dir(lua_State *L) { #ifdef _WIN32 lua_settop(L, 1); - if (strchr("\\/", path[strlen(path) - 2]) != NULL) + if (path[0] == 0 || strchr("\\/", path[strlen(path) - 1]) != NULL) lua_pushstring(L, "*"); else lua_pushstring(L, "/*");