2016-09-16 13:10:58 +02:00
|
|
|
---
|
|
|
|
locale.c | 13 +++++++++++++
|
|
|
|
1 file changed, 13 insertions(+)
|
|
|
|
|
2010-02-18 12:17:29 +01:00
|
|
|
--- locale.c
|
|
|
|
+++ locale.c 2004-09-03 10:56:10.000000000 +0000
|
2016-09-16 13:10:58 +02:00
|
|
|
@@ -33,6 +33,10 @@
|
2006-12-15 18:03:59 +01:00
|
|
|
#include "bashintl.h"
|
|
|
|
#include "bashansi.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
+#include <sys/types.h>
|
|
|
|
+#include <sys/stat.h>
|
|
|
|
+#include <unistd.h>
|
|
|
|
+#include <errno.h>
|
|
|
|
#include "chartypes.h"
|
2009-08-28 17:45:57 +02:00
|
|
|
#include <errno.h>
|
2006-12-15 18:03:59 +01:00
|
|
|
|
2016-09-16 13:10:58 +02:00
|
|
|
@@ -76,6 +80,15 @@ void
|
2006-12-15 18:03:59 +01:00
|
|
|
set_default_locale ()
|
|
|
|
{
|
|
|
|
#if defined (HAVE_SETLOCALE)
|
|
|
|
+ struct stat st;
|
|
|
|
+
|
|
|
|
+ if (stat("/usr/lib/locale/locale-archive", &st) == 0 && st.st_size == 0) {
|
|
|
|
+ errno = EINVAL;
|
|
|
|
+ sys_error("set_default_locale: broken locale");
|
|
|
|
+ fprintf (stderr, "%s: Please remove /usr/lib/locale/locale-archive\n",
|
|
|
|
+ get_name_for_error());
|
|
|
|
+ sleep(1);
|
|
|
|
+ }
|
|
|
|
default_locale = setlocale (LC_ALL, "");
|
|
|
|
if (default_locale)
|
|
|
|
default_locale = savestring (default_locale);
|