sbase

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

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

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>

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

diff --git a/basename.c b/basename.c @@ -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();