diff options
author | Anton Kling <anton@kling.gg> | 2023-11-15 21:13:36 +0100 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2023-11-15 22:11:26 +0100 |
commit | 835101f96e7c9fca00940e967c471c33e4e4dae9 (patch) | |
tree | 9c48b871d4b547fac8c3a2eda6c21242e593fdfd /userland/minibox/utilities | |
parent | c9358cdeac4522922df46fb6e3ab6a517203ec99 (diff) |
VFS/LibC: Add getcwd()
Diffstat (limited to 'userland/minibox/utilities')
-rw-r--r-- | userland/minibox/utilities/ls.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/userland/minibox/utilities/ls.c b/userland/minibox/utilities/ls.c index dc93d36..bedc3a3 100644 --- a/userland/minibox/utilities/ls.c +++ b/userland/minibox/utilities/ls.c @@ -22,14 +22,16 @@ int ls_main(int argc, char **argv) { }*/ struct dirent **namelist; int n; - COND_PERROR_EXP(-1 == (n = scandir("/", &namelist, 0, 0)), "scandir", + char path[256]; + (void)getcwd(path, 256); + COND_PERROR_EXP(-1 == (n = scandir(path, &namelist, 0, 0)), "scandir", return 1); int prev = 0; for (int i = 0; i < n; i++) { if (!list_hidden) if ('.' == *namelist[i]->d_name) - continue; + continue; if (prev) putchar(newline ? '\n' : ' '); |