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:
@@ -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__
|
||||
|
||||
Reference in New Issue
Block a user