summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Whitley2001-03-27 16:35:16 +0000
committerMark Whitley2001-03-27 16:35:16 +0000
commit1c6581a8659219c09bc33ae45b81d3fd547c3d08 (patch)
tree9d234ba0c9e363b5b0a529ab0357b28b7c10aafc
parentaf633757d3a7c2830851446278161618141f2e54 (diff)
downloadbusybox-1c6581a8659219c09bc33ae45b81d3fd547c3d08.zip
busybox-1c6581a8659219c09bc33ae45b81d3fd547c3d08.tar.gz
Applied patch from Vladimir N. Oleynik to add locale support to the shell per
bug report from Ralph Jones.
-rw-r--r--lash.c6
-rw-r--r--sh.c6
-rw-r--r--shell/lash.c6
3 files changed, 18 insertions, 0 deletions
diff --git a/lash.c b/lash.c
index e33fd36..ca0d4bb 100644
--- a/lash.c
+++ b/lash.c
@@ -64,6 +64,7 @@
#include <sys/wait.h>
#include <unistd.h>
#include <getopt.h>
+#include <locale.h>
//#define BB_FEATURE_SH_WORDEXP
@@ -446,6 +447,11 @@ static int builtin_export(struct child_prog *child)
else if (strncmp(v, "PS2=", 4)==0)
PS2 = getenv("PS2");
#endif
+ if(strncmp(v, "LC_ALL=", 7)==0)
+ setlocale(LC_ALL, getenv("LC_ALL"));
+ if(strncmp(v, "LC_CTYPE=", 7)==0)
+ setlocale(LC_CTYPE, getenv("LC_CTYPE"));
+
return (res);
}
diff --git a/sh.c b/sh.c
index e33fd36..ca0d4bb 100644
--- a/sh.c
+++ b/sh.c
@@ -64,6 +64,7 @@
#include <sys/wait.h>
#include <unistd.h>
#include <getopt.h>
+#include <locale.h>
//#define BB_FEATURE_SH_WORDEXP
@@ -446,6 +447,11 @@ static int builtin_export(struct child_prog *child)
else if (strncmp(v, "PS2=", 4)==0)
PS2 = getenv("PS2");
#endif
+ if(strncmp(v, "LC_ALL=", 7)==0)
+ setlocale(LC_ALL, getenv("LC_ALL"));
+ if(strncmp(v, "LC_CTYPE=", 7)==0)
+ setlocale(LC_CTYPE, getenv("LC_CTYPE"));
+
return (res);
}
diff --git a/shell/lash.c b/shell/lash.c
index e33fd36..ca0d4bb 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -64,6 +64,7 @@
#include <sys/wait.h>
#include <unistd.h>
#include <getopt.h>
+#include <locale.h>
//#define BB_FEATURE_SH_WORDEXP
@@ -446,6 +447,11 @@ static int builtin_export(struct child_prog *child)
else if (strncmp(v, "PS2=", 4)==0)
PS2 = getenv("PS2");
#endif
+ if(strncmp(v, "LC_ALL=", 7)==0)
+ setlocale(LC_ALL, getenv("LC_ALL"));
+ if(strncmp(v, "LC_CTYPE=", 7)==0)
+ setlocale(LC_CTYPE, getenv("LC_CTYPE"));
+
return (res);
}