]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(find_field): Don't count trailing newline to be
authorJim Meyering <jim@meyering.net>
Sat, 25 Aug 2001 05:42:46 +0000 (05:42 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 25 Aug 2001 05:42:46 +0000 (05:42 +0000)
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.

src/uniq.c

index f46bdaa52c4abe710749b677a97c17eaa6acbf23..42f33a2064f2f92b487e367a263895d49d95b3b6 100644 (file)
@@ -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++)