From b3633108b277f9cd351c5ffae2779b6c346683f7 Mon Sep 17 00:00:00 2001 From: Emil Williams Date: Sat, 28 Sep 2024 22:25:06 +0000 Subject: [PATCH] longopt select fix --- bake.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bake.l b/bake.l index 6b3ff86..f8bc334 100644 --- 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; } -- 2.39.5