bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23665: spaces in keys: doc, --debug in LC_ALL=C


From: Assaf Gordon
Subject: bug#23665: spaces in keys: doc, --debug in LC_ALL=C
Date: Tue, 31 May 2016 20:38:11 -0400

Hello Karl and all,

> On May 31, 2016, at 19:15, Karl Berry <address@hidden> wrote:
[...]
> I'm not sure what you mean by [...].  The %lu?
> Are you proposing to just add the word "sort"?  That's not needed IMHO.

I was suggesting exactly that :)
Also, the word "key" appears in few other messages, the attached patch adds 
"sort" to them all. This is of course just a suggestion, and we can use another 
syntax like the one you listed.

Attached are 3 patches, not finalized but good as a starting point for comments.

1. rephrase "key" with "sort key". Perhaps this is superfluous - thoughts ?

2. add a bit more verbose progress information to the 'sort-debug-warn.sh' test 
- just so it'll be easier to discuss to the changed messages.

3. removes the 'maybe_space_aligned' and modifies the condition a bit.

Expanding on the third patch:
In the following two tests, the "leading space" warning is now printed (the 
numbers refer to the numbers added in patch 2):
   #7 
   sort -gbr -k1,1n -k1,1r --debug /dev/null
   #11
   sort -k1,1r --debug /dev/null

I would say this is correct, as spaces do matter for LC_ALL=C with "-r" sorting:

    $ cat -A 1.txt 
    x  A$
    x   B$
    x C$

    $ LC_ALL=C ./src/sort -k2,2r 1.txt 
    x C
    x  A
    x   B

    $ LC_ALL=C ./src/sort -k2b,2r 1.txt 
    x C
    x   B
    x  A

The "leading space" warning is removed from the last test, because for keys 
that are "zero widths" and are ignored there's no point in printing the warning.


Comments welcomed,
  - assaf


Attachment: 0001-sort-clearify-key-meaning-in-debug-warnings.patch
Description: Binary data


Attachment: 0002-tests-sort-debug-warn-add-progress-information-lines.patch
Description: Binary data


Attachment: 0003-sort-modify-leading-spaces-debug-warning-scenarios.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]