From f07463b72cfbadd2bac1d84d91550b9f2228d537 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 5 Jul 2002 06:25:14 +0000 Subject: [PATCH] * argparse.c (initialize): We better exit after a read error so that we don't run into an endless loop when reading a directory. Noted by Andrew Suffield. --- util/ChangeLog | 6 ++++++ util/argparse.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/util/ChangeLog b/util/ChangeLog index 9550271d9..5bbd47455 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,9 @@ +2002-07-05 Werner Koch + + * argparse.c (initialize): We better exit after a read error so + that we don't run into an endless loop when reading a directory. + Noted by Andrew Suffield. + 2002-07-01 David Shaw * argparse.c (optfile_parse): Fix variable typo - 'p2' should be diff --git a/util/argparse.c b/util/argparse.c index cd518d138..2ca0ff8ff 100644 --- a/util/argparse.c +++ b/util/argparse.c @@ -192,7 +192,7 @@ initialize( ARGPARSE_ARGS *arg, const char *filename, unsigned *lineno ) s = "Invalid option \"%.50s\"\n"; log_error(s, arg->internal.last? arg->internal.last:"[??]" ); } - if( arg->err != 1 ) + if( arg->err != 1 || arg->r_opt == -5 ) exit(2); arg->err = 0; }