ipl: Add trailing "/" when listing directories
If user runs "ls 6/var", then he actually wants the contents of
directory /var. Add a trailing slash to make this happen.
Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/ipl/ipl.c b/ipl/ipl.c
index b69cfb6..22abca6 100644
--- a/ipl/ipl.c
+++ b/ipl/ipl.c
@@ -426,9 +426,13 @@
if (numbuf[0] == 'l')
{
join(commandline, argc, argv, ok);
- if (numbuf[1] == ' ')
+ if (numbuf[1] == ' ') {
+ /* add trailing slash */
+ p = strrchr(numbuf, '/');
+ if (p && p[1] != 0)
+ strcat(numbuf, "/");
ls(&numbuf[2]);
- else
+ } else
ls(argv[0]);
continue;
}