From 5e1a554712c61a3ffbe9b9e3ca1be54cb4d4f74d Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Sun, 17 Feb 2019 19:16:37 -0800 Subject: [PATCH] sort: clarify in --debug; only text comparisons affected * src/sort.c (main): Adjust the debug info regarding locales, to clarify that only textual comparisons are affected. * tests/misc/sort-debug-warn.sh: Adjust accordingly. Fixes https://bugs.gnu.org/34490 --- src/sort.c | 5 +++-- tests/misc/sort-debug-warn.sh | 38 +++++++++++++++++------------------ 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/sort.c b/src/sort.c index 5ab363f8c4..d812aa9990 100644 --- a/src/sort.c +++ b/src/sort.c @@ -4689,10 +4689,11 @@ main (int argc, char **argv) if (! locale_ok) error (0, 0, "%s", _("failed to set locale")); if (hard_LC_COLLATE) - error (0, 0, _("using %s sorting rules"), + error (0, 0, _("text ordering performed using %s sorting rules"), quote (setlocale (LC_COLLATE, NULL))); else - error (0, 0, "%s", _("using simple byte comparison")); + error (0, 0, "%s", + _("text ordering performed using simple byte comparison")); key_warnings (&gkey, gkey_only); } diff --git a/tests/misc/sort-debug-warn.sh b/tests/misc/sort-debug-warn.sh index 3cb521cec7..cb9a9d67be 100755 --- a/tests/misc/sort-debug-warn.sh +++ b/tests/misc/sort-debug-warn.sh @@ -21,55 +21,55 @@ print_ver_ sort cat <<\EOF > exp 1 -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison sort: key 1 has zero width and will be ignored 2 -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison sort: key 1 has zero width and will be ignored 3 -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison sort: key 1 is numeric and spans multiple fields 4 -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison sort: options '-bghMRrV' are ignored 5 -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison sort: options '-bghMRV' are ignored sort: option '-r' only applies to last-resort comparison 6 -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison sort: option '-r' only applies to last-resort comparison 7 -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison sort: leading blanks are significant in key 2; consider also specifying 'b' sort: options '-bg' are ignored 8 -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison 9 -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison sort: option '-b' is ignored 10 -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison 11 -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison sort: leading blanks are significant in key 1; consider also specifying 'b' 12 -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison sort: leading blanks are significant in key 1; consider also specifying 'b' 13 -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison sort: leading blanks are significant in key 1; consider also specifying 'b' sort: option '-d' is ignored 14 -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison sort: leading blanks are significant in key 1; consider also specifying 'b' sort: option '-i' is ignored 15 -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison 16 -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison 17 -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison EOF echo 1 >> out @@ -112,7 +112,7 @@ compare exp out || fail=1 cat <<\EOF > exp sort: failed to set locale -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison EOF LC_ALL=missing sort --debug /dev/null 2>out @@ -126,7 +126,7 @@ fi cat <<\EOF > exp -sort: using simple byte comparison +sort: text ordering performed using simple byte comparison sort: key 1 is numeric and spans multiple fields sort: obsolescent key '+2 -1' used; consider '-k 3,1' instead sort: key 2 has zero width and will be ignored -- 2.47.2