bugGNU nano - Bugs: bug #59059, equivalent filenames are left...


You are not allowed to post comments on this tracker with your current authentication level.

bug #59059: equivalent filenames are left unsorted in the browser

Submitter:  Benno Schulenberg <bens>
Submitted:  Thu 03 Sep 2020 01:32:26 PM UTC
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Thu 03 Sep 2020 02:34:52 PM UTC, comment #2: 

Fixed in git, commit bbc7c595, by breaking the tie (when a case-insensitive comparison finds no diffence) with a plain bytewise strcmp().

Benno Schulenberg <bens>
Project Administrator
Thu 03 Sep 2020 02:33:17 PM UTC, comment #1: 

It would be easy to fix by calling strcoll() instead of mbstrcasecmp() in diralphasort() in src/files.c.  But that would also mean that, for example, .git/ would get sorted between doc/ and gnulib, which I don't expect, and that uppercase gets sorted after lowercase, which I find ugly.  (Only now I realize that 'ls' sorts things that way too, I just never noticed, because I seldom use 'ls -a' and filenames are virtually never differ only in case.)

Benno Schulenberg <bens>
Project Administrator
Thu 03 Sep 2020 01:32:26 PM UTC, original submission:  

To reproduce, first do:

touch a b c d e f g h i j k l m n o p q r s t u v w x y z
touch A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
touch 11111111111111111111

(In that last line, use enough ones to cover a third of the width of the terminal.)

Now, in a UTF-8 locale, do 'ls -1' and see that the lowercase name is sorted consistently before the uppercase name.  (This is unexpected, but apparently this is the agreed-upon collating sequence in a UTF-8 locale.)  Now run nano and type: ^R ^T.  See that each of the two columns is a mix of uppercase and lowercase letters.

Expected behavior: if two filenames differ only in the case of one or some of their characters, then the name with the relevant uppercase letter should come first, like in the C locale.

Benno Schulenberg <bens>
Project Administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by bens (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-10-08 bens Open/ClosedOpen Closed
    2020-09-03 bens StatusIn Progress Fixed
    2020-09-03 bens StatusNone In Progress
        Assigned toNone bens

    Back to the top

    Powered by Savane 3.9