Opened 7 years ago

Closed 7 years ago

#9515 closed bug (invalid)

Issue with natural sorting

Reported by: mmadia Owned by: axeld
Priority: normal Milestone: R1
Component: Applications/Tracker Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description (last modified by mmadia)

hrev45285

#!/bin/bash
files="001-.txt \
	001.txt \
	01-.txt \
	01.txt \
	1-.txt \
	1-0-.txt \
	1-0.txt \
	1.txt"
	
for file in $files; do 
	touch $file
done
~/Desktop/test> ls -1
001-.txt
001.txt
01-.txt
01.txt
1-.txt
1-0-.txt
1-0.txt
1.txt
test-files.sh

Attachments (1)

tracker-natural-sorting-bug.png (34.7 KB ) - added by mmadia 7 years ago.

Download all attachments as: .zip

Change History (5)

by mmadia, 7 years ago

comment:1 by mmadia, 7 years ago

Description: modified (diff)

comment:2 by dsjonny, 7 years ago

Maybe duplicate: #9319

comment:3 by axeld, 7 years ago

Can you please elaborate what issue you see here? I can't see anything wrong with the screen shot, actually. The leading zero is being ignored AFAICT, and the characters afterwards are responsible for the actual ordering.

in reply to:  3 comment:4 by mmadia, 7 years ago

Resolution: invalid
Status: newclosed

Replying to axeld:

Can you please elaborate what issue you see here? I can't see anything wrong with the screen shot, actually. The leading zero is being ignored AFAICT, and the characters afterwards are responsible for the actual ordering.

For some reason, I didn't consider that the leading zero would be ignored.

Note: See TracTickets for help on using tickets.