diff options
author | Elliott Hughes <enh@google.com> | 2018-11-13 14:17:33 -0800 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2018-11-17 14:40:07 -0600 |
commit | d1d751e4be38f192cd45370929f68945f015ef00 (patch) | |
tree | 15f4fca461f86f3bd06564eaa123bed7426367f6 /toys | |
parent | 2559f9dd6b7eedd97e029c80b4b8ba72309db45b (diff) | |
download | toybox-d1d751e4be38f192cd45370929f68945f015ef00.tar.gz |
dirname: support multiple arguments.
Diffstat (limited to 'toys')
-rw-r--r-- | toys/posix/dirname.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/toys/posix/dirname.c b/toys/posix/dirname.c index 06470ad8..fa84af27 100644 --- a/toys/posix/dirname.c +++ b/toys/posix/dirname.c @@ -10,7 +10,7 @@ config DIRNAME bool "dirname" default y help - usage: dirname PATH + usage: dirname PATH... Show directory portion of path. */ @@ -19,5 +19,7 @@ config DIRNAME void dirname_main(void) { - puts(dirname(*toys.optargs)); + char **arg; + + for (arg = toys.optargs; *arg; ++arg) puts(dirname(*arg)); } |