diff options
author | Fredrik Fornwall <fredrik@fornwall.net> | 2015-05-24 23:05:48 +0200 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2020-03-28 21:42:54 +0000 |
commit | 2133c29de320e3173d7cb1aec32676afa8b0dc17 (patch) | |
tree | 1b603442abf5a4d5ba61bd7d648207ea7584cc97 | |
parent | 21178cb4e427385a4aba8dc2a2df50f34ae6684e (diff) | |
download | klibc-2133c29de320e3173d7cb1aec32676afa8b0dc17.tar.gz |
[klibc] dash: builtin: Clear LC_ALL in mkbuiltins
[ dash commit fe393c0f9ab72de5a7d32aab53e5e8275cad8735 ]
In mkbuiltins LC_COLLATE is set, but since "The value of the LC_ALL
environment variable has precedence over any of the other environment
variables starting with LC_"
(http://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html), this
has no effect when LC_ALL is set.
This breaks when having e.g. LC_ALL=en_US.UTF-8 during make, which
causes the test case
dash -c :
to fail, probably due to broken ordering in builtins.c. The patch
corrects that by clearing LC_ALL.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | usr/dash/mkbuiltins | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr/dash/mkbuiltins b/usr/dash/mkbuiltins index f412a41b9dc8c..8c74d6b10236a 100644 --- a/usr/dash/mkbuiltins +++ b/usr/dash/mkbuiltins @@ -78,7 +78,7 @@ awk '{ for (i = 2 ; i <= NF ; i++) { if ($i ~ /^-/) line = $(++i) "\t" line print line - }}' $temp | LC_COLLATE=C sort -k 1,1 | tee $temp2 | awk '{ + }}' $temp | LC_ALL= LC_COLLATE=C sort -k 1,1 | tee $temp2 | awk '{ opt = "" if (NF > 2) { opt = substr($2, 2) @@ -97,8 +97,9 @@ cat <<\! */ ! -sed 's/ -[a-z]*//' $temp2 | nl -b a -v 0 | LC_COLLATE=C sort -u -k 3,3 | -tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | +sed 's/ -[a-z]*//' $temp2 | nl -b a -v 0 | + LC_ALL= LC_COLLATE=C sort -u -k 3,3 | + tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | awk '{ printf "#define %s (builtincmd + %d)\n", $3, $1}' printf '\n#define NUMBUILTINS %d\n' $(wc -l < $temp2) echo ' |