From 3b5f7869942737535ef4363a5e83277496c0a403 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 25 Nov 2012 09:25:15 -0500 Subject: [PATCH] No need to change locale in front-end warning()/error(). --- src/error.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/error.c b/src/error.c index d41fb5106..722ffc451 100644 --- a/src/error.c +++ b/src/error.c @@ -24,7 +24,6 @@ #include #include "missing.h" -#include "alloc.h" #include "error.h" #define DEFAULT_TEXT_DOMAIN "sudo" @@ -105,11 +104,6 @@ static void _warning(int use_errno, const char *fmt, va_list ap) { int serrno = errno; - char *prev_locale = estrdup(setlocale(LC_ALL, NULL)); - - /* Set locale to user's if different. */ - if (*prev_locale != '\0') - setlocale(LC_ALL, ""); fputs(getprogname(), stderr); if (fmt != NULL) { @@ -121,9 +115,4 @@ _warning(int use_errno, const char *fmt, va_list ap) fputs(strerror(serrno), stderr); } putc('\n', stderr); - - /* Restore locale if needed. */ - if (*prev_locale != '\0') - setlocale(LC_ALL, prev_locale); - efree(prev_locale); } -- 2.40.0