bug-gnulib
[Top][All Lists]
Advanced

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

Re: ls -v oddity with autosave files


From: Jim Meyering
Subject: Re: ls -v oddity with autosave files
Date: Thu, 09 Apr 2009 15:39:57 +0200

Kamil Dudka wrote:

> On Thursday 09 April 2009 11:32:58 Kamil Dudka wrote:
>> On Thursday 09 April 2009 09:23:37 Sven Joachim wrote:
>> > Note that the #.b# file is listed at the top in (1) and at the bottom in
>> > (2), despite all filenames in the directory being the same!
>>
>> Thanks for discovering this! The transitive axiom of the predicate is
>> broken. I am working on a fix. It seems like a regression from this commit:
>> http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=0443c2f3994
>>3017f0aaa0afacbf68fb725858963
>
> The fix for hidden files was based on a really bad idea. I've replaced it
> with a special handle for "", "." and "..".
>
> Each strcmp compares max 2 or 3 chars, so there is no performance impact
> (tested with -02 with zero impact; with -O0 it takes about 2% more time on
> sorting 100000 items).
>
> The behavior on the current test suite is unchanged and the suite has been
> enlarged with "" and "#.b#". Note that the suite has been already checking
> transitivity of the sort predicate, but the "#.b#" was not included.

Like last time, I applied your patch in gnulib before running coreutils' tests.
I noticed the new resulting failure.
Here's a stand-alone demo:

Before today's patch

  $ for i in 0 9 A Z a z zz~ zz zz.~1~ zz.0; do printf '%s\n' $i .$i;done \
    |sort -V
  .0
  .9
  .A
  .Z
  .a
  .z
  .zz~
  .zz
  .zz.~1~
  .zz.0
  0
  9
  A
  Z
  a
  z
  zz~
  zz
  zz.~1~
  zz.0

After (note how .0, .9, and .zz.0 have moved from top/middle to the bottom):

  $ for i in 0 9 A Z a z zz~ zz zz.~1~ zz.0; do printf '%s\n' $i .$i;done \
    |src/sort -V
  .A
  .Z
  .a
  .z
  .zz~
  .zz
  .zz.~1~
  0
  9
  A
  Z
  a
  z
  zz~
  zz
  zz.~1~
  zz.0
  .0
  .9
  .zz.0




reply via email to

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