1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 21:19:24 +00:00

Open the input file in main.cc, not in class Options.

This commit is contained in:
Bruno Haible
2003-01-21 12:00:44 +00:00
parent 0a3597e6c2
commit d3a9c2f7ad
5 changed files with 41 additions and 9 deletions

View File

@@ -416,6 +416,7 @@ PositionStringParser::nextPosition ()
Options::Options ()
: _option_word (C),
_input_file_name (NULL),
_iterations (0),
_jump (DEFAULT_JUMP_VALUE),
_initial_asso_value (0),
@@ -832,19 +833,15 @@ Options::parse_options (int argc, char *argv[])
}
if (/*getopt*/optind + 1 < argc)
if (/*getopt*/optind < argc)
_input_file_name = argv[/*getopt*/optind++];
if (/*getopt*/optind < argc)
{
fprintf (stderr, "Extra trailing arguments to %s.\n", program_name);
short_usage (stderr);
exit (1);
}
if (argv[/*getopt*/optind] && ! freopen (argv[/*getopt*/optind], "r", stdin))
{
fprintf (stderr, "Cannot open keyword file `%s'\n", argv[/*getopt*/optind]);
short_usage (stderr);
exit (1);
}
}
#ifndef __OPTIMIZE__