From: Jim Meyering Date: Sat, 25 Aug 2001 05:42:46 +0000 (+0000) Subject: (find_field): Don't count trailing newline to be X-Git-Tag: TEXTUTILS-2_0_15~337 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=81cb73491084dd9b9cd8acaedcd099a2a29f6be6;p=thirdparty%2Fcoreutils.git (find_field): Don't count trailing newline to be part of the field. This disagrees with POSIX.2, but it's gotta be a bug in the standard. An interpretations request has been submitted to PASC. --- diff --git a/src/uniq.c b/src/uniq.c index f46bdaa52c..42f33a2064 100644 --- a/src/uniq.c +++ b/src/uniq.c @@ -169,7 +169,7 @@ find_field (const struct linebuffer *line) { register int count; register char *lp = line->buffer; - register size_t size = line->length; + register size_t size = line->length - 1; register size_t i = 0; for (count = 0; count < skip_fields && i < size; count++)