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.