GNU bug report logs - #16561
Bug report for 'head' (and 'wc' et. al.)

Previous Next

Package: coreutils;

Reported by: LGUC <lguribec <at> gmail.com>

Date: Sun, 26 Jan 2014 19:41:03 UTC

Severity: normal

Merged with 16329, 16559, 16560

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16561 in the body.
You can then email your comments to 16561 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#16561; Package coreutils. (Sun, 26 Jan 2014 19:41:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to LGUC <lguribec <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sun, 26 Jan 2014 19:41:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: LGUC <lguribec <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: Bug report for 'head' (and 'wc' et. al.)
Date: Sun, 26 Jan 2014 10:37:54 -0430
[Message part 1 (text/html, inline)]
[head-tst.zip (application/octet-stream, attachment)]

Forcibly Merged 16559 16560 16561. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Mon, 27 Jan 2014 01:13:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#16561; Package coreutils. (Mon, 27 Jan 2014 01:25:02 GMT) Full text and rfc822 format available.

Message #10 received at 16561 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: LGUC <lguribec <at> gmail.com>
Cc: 16561 <at> debbugs.gnu.org
Subject: Re: bug#16561: Bug report for 'head' (and 'wc' et. al.)
Date: Mon, 27 Jan 2014 01:24:23 +0000
forcemerge 16561 16329
stop

On 01/26/2014 03:07 PM, LGUC wrote:
>    THE INCOMPLETE ATTACMENT! (working on sunday makes not my lucky day.
>    Sorry for the inconveniences!.
>    Please disregard the previous 2 mails)
>      __________________________________________________________________
> 
>    Caracas, Sunday 26th, 2014
>    Ref: Bug report for 'head' (and 'wc' et. al.)
>    Dear friends:
>      Please find attached the text file 'head-tst.txt'
> 
>      As you easily can see, the following command fails and do not print
>    anything, even if the file has:  6 lines,  49 words and  250 chars:
>      'head -n -0 head-tst.txt'
>      The last line on the file does NOT end with a '\n', and this seems
>    to be the base of the problem. If you add the last '\n', 'head' works
>    pretty fine.

Right that's an issue, coincidentally recently reported:
http://bugs.gnu.org/16329
We'll include the fix for that soon.

>      So this seems to be a problem with the definition of a 'text line':
>    I guess that a line that has around 68 normal chars and 13 spaces, is
>    a good candidate to be considered as a line.
>      I found the same problem in several other core utils, being the
>    most remarcable 'wc'. If you executes:
>      'wc head-tst.txt'
>      you will get:
>        5  49 250 head-tst.txt
>      what is wrong, as the file has six (6) lines instead of five (5).
>    The last one line is missing due to the fact that it does not
>    include a '\n' at the end.
>      In 1998 I fix 'wc', and I have attached 'wc-fix.c' including only
>    the most remarkable aspects, in case it could be of any help.

So wc is different and is defined by POSIX to only count '\n' chars.
So we can't change that really. We might be able to add a --visible-lines
option that would handle this and also unicode line separators etc.
But that would require more debate since it would be a new option.

thanks,
Pádraig.





Forcibly Merged 16329 16559 16560 16561. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Mon, 27 Jan 2014 01:25:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 26 Feb 2014 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 117 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.