diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-02-15 17:12:34 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-02-15 17:12:34 +0100 |
| commit | 919b48f8e237a8c8b5b91c05304c817eec49e8f0 (patch) | |
| tree | 9e01e016f6d3a07aa2b86eb8c542bc1a90784d8c | |
| parent | 99fdad9a3abc7f3ba871575f585d254351e5a8d3 (diff) | |
add '/' on end when non root
| -rw-r--r-- | core/cwd.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -6,6 +6,12 @@ char buf[1024] = { 0 }; int main() { getcwd(buf, 1024); - wstdf("%s\n", buf); + + if (buf[0] == '/' && buf[1] == 0) { + wstdf("%s\n", buf); + } else { + wstdf("%s/\n", buf); + } + return 0; } |