iomenu

interactive text selection menu
Log | Files | Refs | README | LICENSE

commit c03da0d703ba0161edd18fb0af36e3891ff56b4c
parent f979f7c13ea6a13dfda617bc70e2e4cff9bd3879
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun, 16 Apr 2017 13:27:20 +0200

fixed argument parsing -_-

Diffstat:
Miomenu.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/iomenu.c b/iomenu.c @@ -443,13 +443,13 @@ usage(void) int main(int argc, char *argv[]) { - extern char *opt_p; + extern char *opt_p, *argv0; extern int opt_l; int exit_code; - for (argv0 = argv[0], argv++, argc--; argc > 0; argv++, argc++) { - if ((*argv)[0] != '-' || (*argv)[1] == '\0' || (*argv)[2] != '\0') + for (argv0 = argv[0], argv++, argc--; argc > 0; argv++, argc--) { + if (argv[0][0] != '-') usage(); switch ((*argv)[1]) {