aboutsummaryrefslogtreecommitdiff
path: root/lpm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lpm.c')
-rw-r--r--lpm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lpm.c b/lpm.c
index 6c6d55b..d8e0376 100644
--- a/lpm.c
+++ b/lpm.c
@@ -131,7 +131,7 @@ static int lpm_ls(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, "/*");