diff --git a/etc/test_options.pl b/etc/test_options.pl index e6d238f1..a32f3cf9 100755 --- a/etc/test_options.pl +++ b/etc/test_options.pl @@ -147,6 +147,7 @@ tests => [ { cmd => "$TECO -z", result => 'Unknown option' }, { cmd => "$TECO --foo", result => 'Unknown option' }, + { cmd => 'teco --baz', result => 'Unknown option' }, ], }, { diff --git a/include/version.h b/include/version.h index e98b0e72..93a65dc0 100644 --- a/include/version.h +++ b/include/version.h @@ -34,7 +34,7 @@ enum release_version ///< TECO release version numbers { major_version = 200, minor_version = 36, - patch_version = 3 + patch_version = 4 }; #endif // !defined(_VERSION_H) diff --git a/src/option_sys.c b/src/option_sys.c index 9f5a8041..8b108854 100644 --- a/src/option_sys.c +++ b/src/option_sys.c @@ -581,7 +581,7 @@ static void parse_options( opterr = 0; // Suppress any error messages int c; // Current option - int lastind = optind; // Used to analyze errors (see below) + int lastind = 1; // Used to analyze errors (see below) while ((c = getopt_long(argc, (char * const *)argv, optstring, long_options, NULL)) != -1)