bug-coreutils
[Top][All Lists]
Advanced

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

bug#5958: Sort-8.4 bug


From: Pádraig Brady
Subject: bug#5958: Sort-8.4 bug
Date: Tue, 20 Apr 2010 17:35:11 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

On 20/04/10 09:37, Alan Curry wrote:
> --- coreutils-8.4.orig/src/sort.c     2010-04-20 02:45:35.000000000 -0500
> +++ coreutils-8.4/src/sort.c  2010-04-20 03:12:57.000000000 -0500
> @@ -1460,9 +1460,6 @@
>    char *ptr = line->text, *lim = ptr + line->length - 1;
>    size_t eword = key->eword, echar = key->echar;
>  
> -  if (echar == 0)
> -    eword++; /* Skip all of end field.  */
> -
>    /* Move PTR past EWORD fields or to one past the last byte on LINE,
>       whichever comes first.  If there are more than EWORD fields, leave
>       PTR pointing at the beginning of the field having zero-based index,
> @@ -3424,6 +3421,8 @@
>                    s = parse_field_count (s + 1, &key->echar,
>                                           N_("invalid number after `.'"));
>                  }
> +              if (key->echar == 0)
> +                key->eword++; /* Skip all of end field.  */
>                s = set_ordering (s, key, bl_end);
>              }
>            if (*s)

I've changed it around in the attached patch so that
we consistently use zero based limits throughout the code.
I'll push this later on tonight unless there are objections.

cheers,
Pádraig.

Attachment: sort-key-limit.diff
Description: Text Data


reply via email to

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