diff options
author | Michael Forney <mforney@mforney.org> | 2019-07-06 15:33:46 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-07-06 15:33:46 -0700 |
commit | 4b3e5a6bd64335ad207167fa8fd39a098c50c1db (patch) | |
tree | f7992597e5f535c33b473e92da4d2b112eb90149 | |
parent | 347b7d0aaaf790df992340525cae076d35d3f27e (diff) | |
download | cproc-4b3e5a6bd64335ad207167fa8fd39a098c50c1db.tar.xz |
Handle argv = { NULL } in ARGBEGIN
-rw-r--r-- | arg.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,6 +1,7 @@ #define ARGBEGIN \ for (;;) { \ - ++argv, --argc; \ + if (argc > 0) \ + ++argv, --argc; \ if (argc == 0 || (*argv)[0] != '-') \ break; \ if ((*argv)[1] == '-' && !(*argv)[2]) { \ |