mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
(initialize): Replaced use of non-literal forma
args. Suggested by Florian Weimer.
This commit is contained in:
parent
1114bc6430
commit
911daed647
@ -1,3 +1,8 @@
|
|||||||
|
2003-12-17 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* argparse.c (initialize): Replaced use of non-literal forma
|
||||||
|
args. Suggested by Florian Weimer.
|
||||||
|
|
||||||
2003-12-16 Werner Koch <wk@gnupg.org>
|
2003-12-16 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
* logging.c (writen, fun_writer, fun_closer): New.
|
* logging.c (writen, fun_writer, fun_closer): New.
|
||||||
|
@ -165,35 +165,37 @@ initialize( ARGPARSE_ARGS *arg, const char *filename, unsigned *lineno )
|
|||||||
|
|
||||||
if( filename ) {
|
if( filename ) {
|
||||||
if( arg->r_opt == -6 )
|
if( arg->r_opt == -6 )
|
||||||
s = "%s:%u: argument not expected\n";
|
s = "argument not expected\n";
|
||||||
else if( arg->r_opt == -5 )
|
else if( arg->r_opt == -5 )
|
||||||
s = "%s:%u: read error\n";
|
s = "read error\n";
|
||||||
else if( arg->r_opt == -4 )
|
else if( arg->r_opt == -4 )
|
||||||
s = "%s:%u: keyword too long\n";
|
s = "keyword too long\n";
|
||||||
else if( arg->r_opt == -3 )
|
else if( arg->r_opt == -3 )
|
||||||
s = "%s:%u: missing argument\n";
|
s = "missing argument\n";
|
||||||
else if( arg->r_opt == -7 )
|
else if( arg->r_opt == -7 )
|
||||||
s = "%s:%u: invalid command\n";
|
s = "invalid command\n";
|
||||||
else if( arg->r_opt == -10 )
|
else if( arg->r_opt == -10 )
|
||||||
s = "%s:%u: invalid alias definition\n";
|
s = "invalid alias definition\n";
|
||||||
else
|
else
|
||||||
s = "%s:%u: invalid option\n";
|
s = "invalid option\n";
|
||||||
jnlib_log_error(s, filename, *lineno );
|
jnlib_log_error("%s:%u: %s\n", filename, *lineno, s);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
s = arg->internal.last? arg->internal.last:"[??]";
|
||||||
|
|
||||||
if( arg->r_opt == -3 )
|
if( arg->r_opt == -3 )
|
||||||
s = "Missing argument for option \"%.50s\"\n";
|
jnlib_log_error ("Missing argument for option \"%.50s\"\n", s);
|
||||||
else if( arg->r_opt == -6 )
|
else if( arg->r_opt == -6 )
|
||||||
s = "Option \"%.50s\" does not expect an argument\n";
|
jnlib_log_error ("Option \"%.50s\" does not expect an argument\n",
|
||||||
|
s );
|
||||||
else if( arg->r_opt == -7 )
|
else if( arg->r_opt == -7 )
|
||||||
s = "Invalid command \"%.50s\"\n";
|
jnlib_log_error ("Invalid command \"%.50s\"\n", s);
|
||||||
else if( arg->r_opt == -8 )
|
else if( arg->r_opt == -8 )
|
||||||
s = "Option \"%.50s\" is ambiguous\n";
|
jnlib_log_error ("Option \"%.50s\" is ambiguous\n", s);
|
||||||
else if( arg->r_opt == -9 )
|
else if( arg->r_opt == -9 )
|
||||||
s = "Command \"%.50s\" is ambiguous\n";
|
jnlib_log_error ("Command \"%.50s\" is ambiguous\n",s );
|
||||||
else
|
else
|
||||||
s = "Invalid option \"%.50s\"\n";
|
jnlib_log_error ("Invalid option \"%.50s\"\n", s);
|
||||||
jnlib_log_error(s, arg->internal.last? arg->internal.last:"[??]" );
|
|
||||||
}
|
}
|
||||||
if( arg->err != 1 )
|
if( arg->err != 1 )
|
||||||
exit(2);
|
exit(2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user