Should exit successfully when printing version and usage info.
authorDavid Griffith <dave@661.org>
Tue, 22 Oct 2019 10:29:08 +0000 (03:29 -0700)
committerDavid Griffith <dave@661.org>
Tue, 22 Oct 2019 10:35:58 +0000 (03:35 -0700)
src/curses/ux_init.c
src/dumb/dumb_init.c
src/sdl/sf_util.c

index b0a213c38ce5d41823d50e841601a0d7862988c9..74fa8e9a41d1b183b481d921531ed0acb9871d38 100644 (file)
@@ -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
index 9d4700556917e177c7839498845220647b47e570..079a2d7104881f1c28b3be94e702e97c2409554c 100644 (file)
@@ -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 */
index eab42cf462acce8e5d7dfc09443e867339fad138..7ae01c0d397ac783938a1e326fcbd04dc7261000 100644 (file)
@@ -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]);