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

@@ -23,16 +23,10 @@
#include <stdlib.h>
#include <string.h>
#include <setjmp.h>
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# include "compat/stdbool.h"
#endif /* HAVE_STDBOOL_H */
#include "missing.h"
#include "alloc.h"
#include "error.h"
#include "logging.h"
#include "sudo_plugin.h"
#define DEFAULT_TEXT_DOMAIN "sudoers"
@@ -131,10 +125,7 @@ vwarningx2(const char *fmt, va_list ap)
static void
_warning(int use_errno, const char *fmt, va_list ap)
{
int oldlocale, serrno = errno;
/* Warnings are displayed in the user's locale. */
sudoers_setlocale(SUDOERS_LOCALE_USER, &oldlocale);
int serrno = errno;
if (sudo_conv != NULL) {
struct sudo_conv_message msg[6];
@@ -176,6 +167,4 @@ _warning(int use_errno, const char *fmt, va_list ap)
}
putc('\n', stderr);
}
sudoers_setlocale(oldlocale, NULL);
}