basename: support --
POSIX-2017 clarifies that -- and normal option parsing must be supported. See EXAMPLES in basename(1p). Signed-off-by: Mattias Andrée <maandree@kth.se>
This commit is contained in:
parent
f45156d5b4
commit
1d885159f2
@ -17,7 +17,10 @@ main(int argc, char *argv[])
|
||||
ssize_t off;
|
||||
char *p;
|
||||
|
||||
argv0 = *argv, argv0 ? (argc--, argv++) : (void *)0;
|
||||
ARGBEGIN {
|
||||
default:
|
||||
usage();
|
||||
} ARGEND
|
||||
|
||||
if (argc != 1 && argc != 2)
|
||||
usage();
|
||||
|
Loading…
Reference in New Issue
Block a user