sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

commit 084b46ac51e36bfa6491008ca78c857f297f70fe
parent 1d885159f2f7ff68ed75d92af584174a1208ca01
Author: Mattias Andrée <maandree@kth.se>
Date:   Fri,  6 Jul 2018 23:19:30 +0200

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>

Diffstat:
dirname.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

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