]> git.xolatile.top Git - emil-bake.git/commitdiff
longopt select fix
authorEmil Williams <emilemilemil@cock.li>
Sat, 28 Sep 2024 22:25:06 +0000 (22:25 +0000)
committerEmil Williams <emilemilemil@cock.li>
Sat, 28 Sep 2024 22:25:06 +0000 (22:25 +0000)
bake.l

diff --git a/bake.l b/bake.l
index 6b3ff8614baa0ee68a24a3630c09ed805bd20471..f8bc334acb3f9fda13205090a1424f300cf0bc7a 100644 (file)
--- a/bake.l
+++ b/bake.l
@@ -146,7 +146,7 @@ int main (int ac, char ** av) {
       if (!strcmp(av[0]+2, "dry-run")) { i = strlen(av[0]);                goto opt_dry_run; }
       if (!strcmp(av[0]+2, "color"))   { i = strlen(av[0]);                goto opt_color;   }
       if (!strcmp(av[0]+2, "expunge")) { i = strlen(av[0]);                goto opt_expunge; }
-      if (!strcmp(av[0]+2, "select" )) { if (!ac-1 || isdigit(av[1][0])) { goto opt_arg;     }
+      if (!strcmp(av[0]+2, "select" )) { if (!(ac-1) || !isdigit(av[1][0])) { goto opt_arg;  }
                                          ++av, --ac; i = strlen(av[0]);    goto opt_select;  }
       if (!strcmp(av[0]+2, "list"   )) { i = strlen(av[0]);                goto opt_list;    }
       if (!strcmp(av[0]+2, "help"   )) {                                   goto opt_help;    }