https://photos-2.getdropbox.com/i/l/atMKvEMmqAGjfNqf47_NT6vq5pCAV7MOXJfFcAeqnnM shows an example. a file called 22222222222 is listed before 11111111111 (both have 11 digits). nautilus lists them in the correct order.
I can confirm this. The sorting order is almost completely random
Created attachment 3939 Patch to fix sorting of files with large numbers in them
The patch looks fine except that G_HAVE_GINT64 is always true, so we don't need the ifdef.
Created attachment 3941 Same as pervious patch but without the #ifndef check Fixed!
Thanks! Applied to master and xfce-4.8: commit 464e9a39f4490b7bd4da0ee902018c9a98950d8f Author: Eric Koegel <eric.koegel@gmail.com> Date: Sun Nov 6 16:58:33 2011 +0300 Fix sorting of filenames with large numbers (bug #5356). Change compare_by_name_using_number() to use guint64. Signed-off-by: Jannis Pohlmann <jannis@xfce.org>
Does this really fix the problem? It looks to me like it just changes the headline from filenames with large (11 digit) numbers are sorted wrongly to filenames with large (21 digit) numbers are sorted wrongly I think if the number is too big to handle we should fail back to sorting alphabetically rather than sorting by the number modulus some large power of 2.
Created attachment 3942 patch to make this work with any length numbers This patch makes compare_by_name_using_number work for any length numbers. It should be also be faster, since it doesn't do any arithmetic. The comment at the end is odd: /* the numbers are equal, and so the higher first digit should * be sorted first, i.e. 'file10' before 'file010', since we * also sort 'file10' before 'file011'. */ We sort file10 before file011 because 10 is smaller than 11, not because of anything to do with higher first digits being sorted first. I'm not sure I understand what the comment is trying to say, but a very similar argument could be made for the exact opposite ordering: /* the numbers are equal, and so the lower first digit should * be sorted first, i.e. 'file010' before 'file10', since we * also sort 'file010' before 'file11'. */