From: David Griffith Date: Tue, 22 Oct 2019 10:29:08 +0000 (-0700) Subject: Should exit successfully when printing version and usage info. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=81c2ab1a6e1754de0d3692db0aae8e20f951505b;p=liskon_frotz.git Should exit successfully when printing version and usage info. --- diff --git a/src/curses/ux_init.c b/src/curses/ux_init.c index b0a213c..74fa8e9 100644 --- a/src/curses/ux_init.c +++ b/src/curses/ux_init.c @@ -310,7 +310,7 @@ void os_process_arguments (int argc, char *argv[]) case 'S': f_setup.script_cols = atoi(zoptarg); break; case 't': u_setup.tandy_bit = 1; break; case 'u': f_setup.undo_slots = atoi(zoptarg); break; - case 'v': print_version(); exit(2); break; + case 'v': print_version(); exit(0); break; case 'w': u_setup.screen_width = atoi(zoptarg); break; case 'x': f_setup.expand_abbreviations = 1; break; case 'Z': @@ -334,7 +334,7 @@ void os_process_arguments (int argc, char *argv[]) puts (INFORMATION); puts (INFO2); - exit (1); + exit (0); } /* This section is exceedingly messy and really can't be fixed diff --git a/src/dumb/dumb_init.c b/src/dumb/dumb_init.c index 9d47005..079a2d7 100644 --- a/src/dumb/dumb_init.c +++ b/src/dumb/dumb_init.c @@ -129,7 +129,7 @@ void os_process_arguments(int argc, char *argv[]) break; case 'v': print_version(); - exit(2); + exit(0); break; case 'w': user_text_width = atoi(zoptarg); @@ -151,7 +151,7 @@ void os_process_arguments(int argc, char *argv[]) printf("FROTZ V%s\tDumb interface.\n", VERSION); puts(INFORMATION); puts(INFO2); - exit(1); + exit(0); } /* Save the story file name */ diff --git a/src/sdl/sf_util.c b/src/sdl/sf_util.c index eab42cf..7ae01c0 100644 --- a/src/sdl/sf_util.c +++ b/src/sdl/sf_util.c @@ -333,7 +333,7 @@ static void parse_options(int argc, char **argv) f_setup.expand_abbreviations = 1; if (c == 'X') { usage(USAGE_EXTENDED); - exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); } if (c == 'Z') if (num >= ERR_REPORT_NEVER && num <= ERR_REPORT_FATAL) @@ -359,7 +359,7 @@ static void print_version(void) printf (" The core and SDL port are currently maintained by David Griffith.\n"); printf(" Frotz's homepage is https://661.org/proj/if/frotz/\n\n"); - exit(2); + exit(EXIT_SUCCESS); } @@ -406,7 +406,7 @@ void os_process_arguments(int argc, char *argv[]) if (argv[zoptind] == NULL) { usage(USAGE_NORMAL); - exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); } f_setup.story_file = strdup(argv[zoptind]);