size_t echar; /* Additional characters in field. */
bool const *ignore; /* Boolean array of characters to ignore. */
char const *translate; /* Translation applied to characters. */
- bool skipsblanks; /* Skip leading blanks at start. */
- bool skipeblanks; /* Skip trailing blanks at finish. */
+ bool skipsblanks; /* Skip leading blanks when finding start. */
+ bool skipeblanks; /* Skip leading blanks when finding end. */
bool numeric; /* Flag for numeric comparison. Handle
strings of digits with optional decimal
point, but no exponential notation. */
/* If we're skipping leading blanks, don't start counting characters
until after skipping past any leading blanks. */
- if (key->skipsblanks)
+ if (key->skipeblanks)
while (ptr < lim && blanks[UCHAR (*ptr)])
++ptr;
return ptr;
}
-/* Return the number of trailing blanks in FIELD, with LEN bytes. */
-
-static size_t
-trailing_blanks (char const *field, size_t len)
-{
- size_t i;
- for (i = len; 0 < i && blanks[UCHAR (field[i - 1])]; i--)
- continue;
- return len - i;
-}
-
/* Fill BUF reading from FP, moving buf->left bytes from the end
of buf->buf to the beginning first. If EOF is reached and the
file wasn't terminated by a newline, supply one. Set up BUF's line
line_start++;
line->keybeg = line_start;
}
- if (key->skipeblanks)
- {
- size_t keylen = line->keylim - line->keybeg;
- line->keylim -= trailing_blanks (line->keybeg, keylen);
- }
}
line_start = ptr;
month = alloca (len + 1);
for (i = 0; i < len; ++i)
month[i] = fold_toupper[UCHAR (s[i])];
- len -= trailing_blanks (month, len);
month[len] = '\0';
do
size_t lena = lima <= texta ? 0 : lima - texta;
size_t lenb = limb <= textb ? 0 : limb - textb;
- if (key->skipeblanks)
- {
- lena -= trailing_blanks (texta, lena);
- lenb -= trailing_blanks (textb, lenb);
- }
-
/* Actually compare the fields. */
if (key->numeric | key->general_numeric)
{