1
0
mirror of https://git.lain.church/bake/bake.git synced 2025-05-18 17:36:43 +00:00

longopt select fix

This commit is contained in:
Emil Williams 2024-09-28 22:25:06 +00:00
parent c791f9f82b
commit b3633108b2
No known key found for this signature in database
GPG Key ID: CEEBC9208C287297

2
bake.l
View File

@ -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; }