From owner-freebsd-bugs@FreeBSD.ORG Tue Jun 7 17:40:12 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5A07816A41C for ; Tue, 7 Jun 2005 17:40:12 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E97E43D53 for ; Tue, 7 Jun 2005 17:40:12 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j57HeBja031841 for ; Tue, 7 Jun 2005 17:40:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j57HeB2P031840; Tue, 7 Jun 2005 17:40:11 GMT (envelope-from gnats) Resent-Date: Tue, 7 Jun 2005 17:40:11 GMT Resent-Message-Id: <200506071740.j57HeB2P031840@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dan Mahoney Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 68BE616A41C for ; Tue, 7 Jun 2005 17:31:51 +0000 (GMT) (envelope-from danm@prime.gushi.org) Received: from prime.gushi.org (prime.gushi.org [65.125.228.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 07F1843D48 for ; Tue, 7 Jun 2005 17:31:50 +0000 (GMT) (envelope-from danm@prime.gushi.org) Received: from prime.gushi.org (danm@localhost.gushi.org [127.0.0.1]) by prime.gushi.org (8.13.4/8.13.4) with ESMTP id j57HaLUV073504 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 7 Jun 2005 13:36:21 -0400 (EDT) Received: (from danm@localhost) by prime.gushi.org (8.13.4/8.13.4/Submit) id j57HaLpj073503; Tue, 7 Jun 2005 13:36:21 -0400 (EDT) Message-Id: <200506071736.j57HaLpj073503@prime.gushi.org> Date: Tue, 7 Jun 2005 13:36:21 -0400 (EDT) From: Dan Mahoney To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/82005: wc utility misreports number of lines (zero) in a one line file X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Dan Mahoney List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2005 17:40:12 -0000 >Number: 82005 >Category: bin >Synopsis: wc utility misreports number of lines (zero) in a one line file >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 07 17:40:11 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Dan Mahoney >Release: FreeBSD 4.10-RELEASE-p2 i386 >Organization: >Environment: System: FreeBSD prime.gushi.org 4.10-RELEASE-p2 FreeBSD 4.10-RELEASE-p2 #0: Fri Sep 10 21:53:55 EDT 2004 danm@prime.gushi.org:/usr/obj/usr/src/sys/PRIME49 i386 Standard make-world compile with above system. >Description: While playing with dos2unix, I stripped all the line endings out of a file. I will probably open a separate bug on that front, however... prime# file dbedit.css dbedit.css: ASCII text, with very long lines, with no line terminators prime# head dbedit.css BODY, html{ font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal; color: #6A7E93; background-color: #E8E8E8; margin: 0; padding: 0; line-height: 16px; text-align: center; background-image: url(images/background-center.gif); background-repeat: repeat-y; background-position: center;}#center { position: relative; top: 0; left: 0; width: 752px; margin-left: auto; margin-right: auto;}#header { position: relative; height: 66px; background-image: url(images/background.gif); line-height: 20px; text-align: center;}#menuHolder { position: relative; height: 22px; background-image: url(images/menuholder.gif);}#menu { color: #FFF; clear:both; position: relative;font-weight: bold; text-align: left; height: 22px; background-image: url(images/menu.gif); line-height: 20px;}#menu :link{ color: #FFF; text-decoration: none;}#menu :visited, :active{ color: #FFF; text-decoration: none;}#menu :hover{ color: #000; text-decoration: underline;}#content { color: #000; clear:both; position: relative; padding: 4px 5px; text-align: left;}#content a:link{ color: #518CE2; font-weight: bold; text-decoration: none;}#content a:visited, a:active{ color: #518CE2; font-weight: bold; text-decoration: none;}#content a:hover{ color: #55688A; font-weight: bold; text-decoration: underline;}prime# prime# wc -l dbedit.css 0 dbedit.css >How-To-Repeat: See above. Create a file with no line endings and use wc -l on it. It will return 0 rather than 1. >Fix: Check if file has any length at all, and don't return zero if so? Not sure of a code-wise fix. >Release-Note: >Audit-Trail: >Unformatted: