From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 26 14:26:56 2014 Received: (at submit) by debbugs.gnu.org; 26 Jan 2014 19:26:56 +0000 Received: from localhost ([127.0.0.1]:36881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7VM7-0008TO-Kg for submit@debbugs.gnu.org; Sun, 26 Jan 2014 14:26:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60325) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7RC4-0000R0-CJ for submit@debbugs.gnu.org; Sun, 26 Jan 2014 10:00:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7RBv-0008UT-FM for submit@debbugs.gnu.org; Sun, 26 Jan 2014 10:00:15 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,MIME_HTML_ONLY,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44553) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7RBv-0008UP-DH for submit@debbugs.gnu.org; Sun, 26 Jan 2014 10:00:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7RBm-000058-VW for bug-coreutils@gnu.org; Sun, 26 Jan 2014 10:00:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7RBe-0008AV-HB for bug-coreutils@gnu.org; Sun, 26 Jan 2014 09:59:58 -0500 Received: from mail-vc0-x22b.google.com ([2607:f8b0:400c:c03::22b]:57686) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7RBe-0008AC-B9 for bug-coreutils@gnu.org; Sun, 26 Jan 2014 09:59:50 -0500 Received: by mail-vc0-f171.google.com with SMTP id le5so2893173vcb.30 for ; Sun, 26 Jan 2014 06:59:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:disposition-notification-to:date:to:from:subject :mime-version:content-type; bh=8gC2rlwkHOjhxkPoxC2dA8oAkLHMSKP752vkysxycGE=; b=pmNWQ9bDZgTJxVtAeLV0u1rBpQcir/a6Yh2W5aDZdgRIhBy/kglYpvi9OGyg13Qo8p qgOE8nLMYg268T8ulN1xO4OGESXMIYiQCQXqBQiw5nje/Z1V6CMsQcLsx225fv5XzWFb N3YC78v7UwhS4QtF12eIgYEZNJf831UWTlEfuN7M73kHQ+4YjdyIynpuuj+8r6S/WaJg zAkbn7BToll+ul+bCrQ7XoMRwIza0r3IkQ3OwkMAkhLe3Abd84YH19NvCrrY+nXVcwZD /npbcysEHc+wBa32+gCvX0jHGehGICnNdKaSGga86kl3UQTC88woH7gMf+CS5DeAVUsc uKzA== X-Received: by 10.58.100.197 with SMTP id fa5mr13192428veb.24.1390748388315; Sun, 26 Jan 2014 06:59:48 -0800 (PST) Received: from LG-LaptopW8.gmail.com (181-182-37-10.genericrev.telcel.net.ve. [181.182.37.10]) by mx.google.com with ESMTPSA id xx10sm4524656vdc.7.2014.01.26.06.59.46 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 26 Jan 2014 06:59:47 -0800 (PST) Message-ID: <52e522e3.aaf6340a.3963.0169@mx.google.com> X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Sun, 26 Jan 2014 10:28:50 -0430 To: bug-coreutils@gnu.org From: LGUC Subject: Bug report for 'head' (and 'wc' et. al.) Mime-Version: 1.0 Content-Type: text/html; charset="us-ascii" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 26 Jan 2014 14:26:53 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) 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.

  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 lines 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.


Best regards,

Luis G. Uribe C.


Attachments inside 'head-tst.zip':
- 'head-tst.txt': text file that makes 'head' core utility to fail
- 'wc-fix.c':     fix to same problem, applyied to 'wc' in 1998

Software ID:
   GNU coreutils 8.15  January 2012  HEAD(1)
   (Cygwin)
From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 26 20:12:25 2014 Received: (at control) by debbugs.gnu.org; 27 Jan 2014 01:12:25 +0000 Received: from localhost ([127.0.0.1]:37054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7akT-0001g3-07 for submit@debbugs.gnu.org; Sun, 26 Jan 2014 20:12:25 -0500 Received: from mail2.vodafone.ie ([213.233.128.44]:63311) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7akR-0001fu-AK for control@debbugs.gnu.org; Sun, 26 Jan 2014 20:12:23 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag4CAC+y5VJtThEL/2dsb2JhbAANTIN8gxu2VIJ8MHeDOQoqVA0CBSECEQI6BgICFQgBAYgGqll2nDAXgSmOAYJZgUkEnxaOXA Received: from unknown (HELO [192.168.1.79]) ([109.78.17.11]) by mail2.vodafone.ie with ESMTP; 27 Jan 2014 01:12:22 +0000 Message-ID: <52E5B276.80602@draigBrady.com> Date: Mon, 27 Jan 2014 01:12:22 +0000 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: control@debbugs.gnu.org X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: forcemerge 16559 16560 16561 stop [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [213.233.128.44 listed in list.dnswl.org] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: forcemerge 16559 16560 16561 stop [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [213.233.128.44 listed in list.dnswl.org] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject forcemerge 16559 16560 16561 stop From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 26 20:24:27 2014 Received: (at control) by debbugs.gnu.org; 27 Jan 2014 01:24:27 +0000 Received: from localhost ([127.0.0.1]:37061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7aw7-00036l-6j for submit@debbugs.gnu.org; Sun, 26 Jan 2014 20:24:27 -0500 Received: from mail2.vodafone.ie ([213.233.128.44]:41132) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7aw4-00036X-7u; Sun, 26 Jan 2014 20:24:25 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApkFAIq05VJtThEL/2dsb2JhbAANTINEUKJPAQGWDYN+gR6DGQEBAQMBMgFGBQsLDQsJFg8JAwIBAgFFBg0BBwEBh3kNA6pSk2uJPBePDQeEOAEDjgGLWIU9hXGIaw Received: from unknown (HELO [192.168.1.79]) ([109.78.17.11]) by mail2.vodafone.ie with ESMTP; 27 Jan 2014 01:24:23 +0000 Message-ID: <52E5B547.2030206@draigBrady.com> Date: Mon, 27 Jan 2014 01:24:23 +0000 From: =?ISO-8859-1?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: LGUC Subject: Re: bug#16561: Bug report for 'head' (and 'wc' et. al.) References: <52e524ee.b075340a.4538.01a5@mx.google.com> In-Reply-To: <52e524ee.b075340a.4538.01a5@mx.google.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control Cc: 16561@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) 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. From unknown Sat Aug 16 18:09:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 26 Feb 2014 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator