Call gettext() on parameters for warning()/warningx() instead of

having warning() do it for us.
This commit is contained in:
Todd C. Miller
2012-11-25 09:34:04 -05:00
parent 15c69e0e3f
commit 7b3d268687
31 changed files with 205 additions and 216 deletions

View File

@@ -184,7 +184,7 @@ parse_args(int argc, char **argv, int *nargc, char ***nargv, char ***settingsp,
break;
case 'C':
if (atoi(optarg) < 3) {
warningx(N_("the argument to -C must be a number greater than or equal to 3"));
warningx(_("the argument to -C must be a number greater than or equal to 3"));
usage(1);
}
sudo_settings[ARG_CLOSEFROM].value = optarg;
@@ -332,11 +332,11 @@ parse_args(int argc, char **argv, int *nargc, char ***nargv, char ***settingsp,
if (ISSET(flags, MODE_LOGIN_SHELL)) {
if (ISSET(flags, MODE_SHELL)) {
warningx(N_("you may not specify both the `-i' and `-s' options"));
warningx(_("you may not specify both the `-i' and `-s' options"));
usage(1);
}
if (ISSET(flags, MODE_PRESERVE_ENV)) {
warningx(N_("you may not specify both the `-i' and `-E' options"));
warningx(_("you may not specify both the `-i' and `-E' options"));
usage(1);
}
SET(flags, MODE_SHELL);
@@ -346,9 +346,9 @@ parse_args(int argc, char **argv, int *nargc, char ***nargv, char ***settingsp,
if (mode == MODE_EDIT &&
(ISSET(flags, MODE_PRESERVE_ENV) || env_add[0] != NULL)) {
if (ISSET(mode, MODE_PRESERVE_ENV))
warningx(N_("the `-E' option is not valid in edit mode"));
warningx(_("the `-E' option is not valid in edit mode"));
if (env_add[0] != NULL)
warningx(N_("you may not specify environment variables in edit mode"));
warningx(_("you may not specify environment variables in edit mode"));
usage(1);
}
if ((runas_user != NULL || runas_group != NULL) &&
@@ -356,11 +356,11 @@ parse_args(int argc, char **argv, int *nargc, char ***nargv, char ***settingsp,
usage(1);
}
if (list_user != NULL && mode != MODE_LIST && mode != MODE_CHECK) {
warningx(N_("the `-U' option may only be used with the `-l' option"));
warningx(_("the `-U' option may only be used with the `-l' option"));
usage(1);
}
if (ISSET(tgetpass_flags, TGP_STDIN) && ISSET(tgetpass_flags, TGP_ASKPASS)) {
warningx(N_("the `-A' and `-S' options may not be used together"));
warningx(_("the `-A' and `-S' options may not be used together"));
usage(1);
}
if ((argc == 0 && mode == MODE_EDIT) ||
@@ -513,7 +513,7 @@ usage_excl(int fatal)
{
debug_decl(usage_excl, SUDO_DEBUG_ARGS)
warningx(N_("Only one of the -e, -h, -i, -K, -l, -s, -v or -V options may be specified"));
warningx(_("Only one of the -e, -h, -i, -K, -l, -s, -v or -V options may be specified"));
usage(fatal);
}