summaryrefslogtreecommitdiff
path: root/coreutils/basename.c
diff options
context:
space:
mode:
authorDenys Vlasenko2011-04-11 03:58:30 +0200
committerDenys Vlasenko2011-04-11 03:58:30 +0200
commitc13ee8c0f32fa816e12f1ac0c55a800066dc1560 (patch)
tree3ef3009d96c7d1273f556e3d5c84919c4fc76c30 /coreutils/basename.c
parent6161cdbb83bc35c20cf582bfce203f3e0632fbda (diff)
downloadbusybox-c13ee8c0f32fa816e12f1ac0c55a800066dc1560.zip
busybox-c13ee8c0f32fa816e12f1ac0c55a800066dc1560.tar.gz
basename,dirname,freeramdisk,rx,raidautorun,runsv,chvt: skip "--" argument
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils/basename.c')
-rw-r--r--coreutils/basename.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/coreutils/basename.c b/coreutils/basename.c
index 177e023..1f7a137 100644
--- a/coreutils/basename.c
+++ b/coreutils/basename.c
@@ -51,6 +51,11 @@ int basename_main(int argc, char **argv)
size_t m, n;
char *s;
+ if (argv[1] && strcmp(argv[1], "--") == 0) {
+ argv++;
+ argc--;
+ }
+
if ((unsigned)(argc-2) >= 2) {
bb_show_usage();
}