summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/locale.c b/locale.c
index 7653f1fe..15738842 100644
--- a/locale.c
+++ b/locale.c
@@ -126,7 +126,15 @@ set_locale_var (var, value)
else if (var[3] == 'A') /* LC_ALL */
{
FREE (lc_all);
- lc_all = value ? savestring (value) : savestring (default_locale);
+ if (value)
+ lc_all = savestring (value);
+ else if (default_locale)
+ lc_all = savestring (default_locale);
+ else
+ {
+ lc_all = xmalloc (1);
+ lc_all[0] = '\0';
+ }
#if defined (HAVE_SETLOCALE)
return (setlocale (LC_ALL, value) != 0);
#else