via -k option. They were being interpreted as zero-indexed.
POSIX says they are 1-based indices.
(keycompare): Don't ignore characters at the end of words
when otherwise they compare equal. Both from Rik Faith
<faith@cs.unc.edu>.
diff = translate[UCHAR (*--texta)] - translate[UCHAR (*--textb)];
break;
}
+ else if (texta == lima && textb < limb) diff = -1;
+ else if (texta < lima && textb == limb) diff = 1;
}
else if (ignore)
while (texta < lima && textb < limb)
diff = *--texta - *--textb;
break;
}
+ else if (texta == lima && textb < limb) diff = -1;
+ else if (texta < lima && textb == limb) diff = 1;
}
else if (translate)
while (texta < lima && textb < limb)
/* Get POS2. */
for (t = 0; digits[UCHAR (*s)]; ++s)
t = t * 10 + *s - '0';
+ if (t)
+ t--;
t2 = 0;
if (*s == '.')
{
for (++s; digits[UCHAR (*s)]; ++s)
t2 = t2 * 10 + *s - '0';
if (t2)
- t--;
+ t2--;
}
key->eword = t;
key->echar = t2;