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:
Mattias Andrée 2018-07-06 23:19:17 +02:00 committed by sin
parent f45156d5b4
commit 1d885159f2
1 changed files with 4 additions and 1 deletions

View File

@ -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();