Kamil Dudka wrote:

> On Thursday 19 March 2009 11:27:11 Sven Joachim wrote:
>> While the ordering of hidden files in "ls -v" seems to be fixed
>> now, there are still inconsistencies.  Here's what I get in the latest
>> snapshot:
>>
>> ,----
>>
>> | LANG=C /usr/local/src/coreutils-7.1.63-8e6a6/src/ls -alv
>> | total 0
>> | drwxr-xr-x 2 sven sven 160 Mar 19 11:13 .
>> | drwxrwxrwt 9 root root 200 Mar 19 11:15 ..
>> | -rw-r--r-- 1 sven sven   0 Mar 19 11:13 a~
>> | -rw-r--r-- 1 sven sven   0 Mar 19 11:13 a
>> | -rw-r--r-- 1 sven sven   0 Mar 19 11:13 a.b
>> | -rw-r--r-- 1 sven sven   0 Mar 19 11:13 a.bc
>> | -rw-r--r-- 1 sven sven   0 Mar 19 11:13 a.b~
>> | -rw-r--r-- 1 sven sven   0 Mar 19 11:13 a.bc~
>>
>> `----
>>
>> Note that a~ sorts before a, but a.b~ after a.b.
>>
>> Regards,
>>         Sven
>
>
> Thanks again! The file suffix regex doesn't match any suffix containing '~'.
>
> I've changed it this way:
> /(\.[A-Za-z][A-Za-z0-9]*)*$/
> /(\.[A-Za-z~][A-Za-z0-9~]*)*$/
>
> Now it works correctly with simple and numbered backups. Simple patch
> including clarifying test cases is attached.

Hi Kamil,

Thanks for fixing that.  Perhaps "~" isn't
the only character we should treat that way.

What do you think of these?

  $ printf '%s\n' a a_ a.b a.b_ a.bc a.bc_|sort -V                            :
  a
  a.b
  a.bc
  a.bc_
  a.b_
  a_

  $ printf '%s\n' a a- a.b a.b- a.bc a.bc-|sort -V                            :
  a
  a.b
  a.bc
  a-
  a.bc-
  a.b-


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to