From: Fredrik Fornwall <fredrik@fornwall.net>
To: dash@vger.kernel.org
Subject: [PATCH] Set LC_ALL instead LC_COLLATE in mkbuiltins
Date: Mon, 18 May 2015 01:15:51 +0200 [thread overview]
Message-ID: <CAOhdH0uf7Kj2noz4vnuLo_06W2HZ4Xwh_Bm5vKC71VHfeswD_Q@mail.gmail.com> (raw)
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 setting LC_ALL instead of LC_COLLATE.
Fredrik
diff -u -r ../dash-0.5.8/src/mkbuiltins ./src/mkbuiltins
--- ../dash-0.5.8/src/mkbuiltins 2014-09-28 04:19:32.000000000 -0400
+++ ./src/mkbuiltins 2015-05-17 19:08:00.076452891 -0400
@@ -78,7 +78,7 @@
if ($i ~ /^-/)
line = $(++i) "\t" line
print line
- }}' $temp | LC_COLLATE=C sort -k 1,1 | tee $temp2 | awk '{
+ }}' $temp | LC_ALL=C sort -k 1,1 | tee $temp2 | awk '{
opt = ""
if (NF > 2) {
opt = substr($2, 2)
@@ -97,7 +97,7 @@
*/
!
-sed 's/ -[a-z]*//' $temp2 | nl -b a -v 0 | LC_COLLATE=C sort -u -k 3,3 |
+sed 's/ -[a-z]*//' $temp2 | nl -b a -v 0 | LC_ALL=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)
$ diff -u -r ../dash-0.5.8/ .
next reply other threads:[~2015-05-17 23:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-17 23:15 Fredrik Fornwall [this message]
2015-05-22 4:25 ` [PATCH] Set LC_ALL instead LC_COLLATE in mkbuiltins Herbert Xu
2015-05-22 4:40 ` Eric Blake
2015-05-22 4:45 ` Herbert Xu
2015-05-22 13:02 ` Eric Blake
2015-05-24 21:05 ` Fredrik Fornwall
2015-05-26 2:49 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOhdH0uf7Kj2noz4vnuLo_06W2HZ4Xwh_Bm5vKC71VHfeswD_Q@mail.gmail.com \
--to=fredrik@fornwall.net \
--cc=dash@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).