Commits

ZyX_I committed cdac339

@/os: Fixed empty directories handling

Comments (0)

Files changed (1)

 "▶2 os.listdir        :: path[, keepdirname] + FS → [component]
 "▶3 s:F.globdir
 function s:F.globdir(directory, ...)
-    return split(glob(fnameescape(a:directory.s:os.sep).
-                \     get(a:000, 0, '*')),
-                \"\n", 1)
+    let r=split(glob(fnameescape(a:directory.s:os.sep).
+               \     get(a:000, 0, '*')),
+               \"\n", 1)
+    return ((len(r)==1 && empty(r[0]))?([]):(r))
 endfunction
 "▲3
 function s:os.listdir(path, ...)