1
0
mirror of git://git.suckless.org/sbase synced 2024-12-21 22:50:16 +00:00

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

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