From 565d58edd238833afaac72b29d9a2d421a614069 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Mon, 25 Mar 2002 16:06:12 +0000 Subject: [PATCH] Fix the case when high letters becomes missing from fold tables for some locales --- usr.bin/sort/init.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/usr.bin/sort/init.c b/usr.bin/sort/init.c index 966d85685e07..2c62ae872a8f 100644 --- a/usr.bin/sort/init.c +++ b/usr.bin/sort/init.c @@ -309,10 +309,9 @@ settables(gflags) Rascii[i] = 255 - i + 1; else Rascii[i] = 255 - i; - if (islower(i)) { - Ftable[i] = Ftable[toupper(i)]; - RFtable[i] = RFtable[toupper(i)]; - } else if (REC_D >= 'A' && REC_D <= 'Z' && i < 'a' && i > REC_D) { + if (islower(i)) + ; + else if (REC_D >= 'A' && REC_D <= 'Z' && i < 'a' && i > REC_D) { Ftable[i] = i + 1; RFtable[i] = Rascii[i] - 1; } else { @@ -335,6 +334,12 @@ settables(gflags) else dtable[i] = 0; } + for (i = 0; i < NBINS; i++) { + if (islower(i)) { + Ftable[i] = Ftable[toupper(i)]; + RFtable[i] = RFtable[toupper(i)]; + } + } Rascii[REC_D] = RFtable[REC_D] = REC_D; if (isupper(REC_D))