dirname: 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:30 +02:00 committed by sin
parent 1d885159f2
commit 084b46ac51

View File

@ -13,7 +13,10 @@ usage(void)
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
argv0 = *argv, argv0 ? (argc--, argv++) : (void *)0; ARGBEGIN {
default:
usage();
} ARGEND
if (argc != 1) if (argc != 1)
usage(); usage();