summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-03-29 13:59:57 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-04-06 14:44:14 +0200
commit70d65438e5fdc8ff7505175299e2d63c0b56db03 (patch)
treeb2465c1ebe10078a5c4d787c3bf85362e6b493b0 /commands
parentb7df35d081673097a5e4f2cc5fcdfeaceaba16a9 (diff)
downloadbarebox-70d65438e5fdc8ff7505175299e2d63c0b56db03.tar.gz
ls: Do not depend on normalise_path()
When we want to show a directory we want to show the path ls is passed, not the normalised one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/ls.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/commands/ls.c b/commands/ls.c
index 771477b..e549918 100644
--- a/commands/ls.c
+++ b/commands/ls.c
@@ -115,11 +115,8 @@ int ls(const char *path, ulong flags)
continue;
}
- if (s.st_mode & S_IFDIR) {
- char *norm = normalise_path(tmp);
- ls(norm, flags);
- free(norm);
- }
+ if (s.st_mode & S_IFDIR)
+ ls(tmp, flags);
}
out:
@@ -158,7 +155,7 @@ static int do_ls(int argc, char *argv[])
flags |= LS_SHOWARG;
if (optind == argc) {
- ret = ls(getcwd(), flags);
+ ret = ls(".", flags);
return ret ? 1 : 0;
}