From: Mark Whitley Date: Tue, 27 Mar 2001 16:35:16 +0000 (-0000) Subject: Applied patch from Vladimir N. Oleynik to add locale support to the shell per X-Git-Tag: 0_51~88 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1c6581a8659219c09bc33ae45b81d3fd547c3d08;p=oweals%2Fbusybox.git Applied patch from Vladimir N. Oleynik to add locale support to the shell per bug report from Ralph Jones. --- diff --git a/lash.c b/lash.c index e33fd369c..ca0d4bb43 100644 --- a/lash.c +++ b/lash.c @@ -64,6 +64,7 @@ #include #include #include +#include //#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 e33fd369c..ca0d4bb43 100644 --- a/sh.c +++ b/sh.c @@ -64,6 +64,7 @@ #include #include #include +#include //#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 e33fd369c..ca0d4bb43 100644 --- a/shell/lash.c +++ b/shell/lash.c @@ -64,6 +64,7 @@ #include #include #include +#include //#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); }