commit 084b46ac51e36bfa6491008ca78c857f297f70fe
Author:     Mattias Andrée <[email protected]>
AuthorDate: Fri Jul 6 23:19:30 2018 +0200
Commit:     sin <[email protected]>
CommitDate: Sat Jul 7 12:16:15 2018 +0100

    dirname: support --
    
    POSIX-2017 clarifies that -- and normal option parsing must be supported.
    See EXAMPLES in basename(1p)
    
    Signed-off-by: Mattias Andrée <[email protected]>

diff --git a/dirname.c b/dirname.c
index 8392bc0..45e1a7e 100644
--- a/dirname.c
+++ b/dirname.c
@@ -13,7 +13,10 @@ usage(void)
 int
 main(int argc, char *argv[])
 {
-       argv0 = *argv, argv0 ? (argc--, argv++) : (void *)0;
+       ARGBEGIN {
+       default:
+               usage();
+       } ARGEND
 
        if (argc != 1)
                usage();

Reply via email to