From: David Griffith Date: Tue, 17 Dec 2013 04:48:24 +0000 (-0800) Subject: Oops with zgetopt. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=f4550ccaebf9045b37de6b71fe6a8874aeb8747e;p=liskon_frotz.git Oops with zgetopt. --- diff --git a/src/curses/ux_init.c b/src/curses/ux_init.c index 6045bea..0ec7bee 100644 --- a/src/curses/ux_init.c +++ b/src/curses/ux_init.c @@ -31,9 +31,6 @@ #include #include -/* We will use our own private getopt functions. */ -//#include "getopt.h" - #ifdef USE_NCURSES_H #include #else @@ -230,8 +227,6 @@ void os_process_arguments (int argc, char *argv[]) (u_setup.foreground_color > 9)) u_setup.foreground_color = -1; break; - - case 'F': u_setup.force_color = 1; u_setup.disable_color = 0; break; @@ -260,7 +255,7 @@ void os_process_arguments (int argc, char *argv[]) } while (c != EOF); - if (optind != argc - 1) { + if (zoptind != argc - 1) { printf("FROTZ V%s\t", VERSION); #ifndef NO_SOUND @@ -284,14 +279,14 @@ void os_process_arguments (int argc, char *argv[]) /* Save the story file name */ - f_setup.story_file = strdup(argv[optind]); - f_setup.story_name = strdup(basename(argv[optind])); + f_setup.story_file = strdup(argv[zoptind]); + f_setup.story_name = strdup(basename(argv[zoptind])); /* Now strip off the extension. */ p = rindex(f_setup.story_name, '.'); *p = 0; - f_setup.story_path = strdup(dirname(argv[optind])); + f_setup.story_path = strdup(dirname(argv[zoptind])); f_setup.script_name = malloc((strlen(f_setup.story_name) + strlen(EXT_SCRIPT)) * sizeof(char) + 1); strncpy(f_setup.script_name, f_setup.story_name, strlen(f_setup.story_name) + 1);