NetBSD Problem Report #55660

From www@netbsd.org  Mon Sep 14 21:10:48 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id E79701A9239
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 14 Sep 2020 21:10:47 +0000 (UTC)
Message-Id: <20200914211046.A1A4D1A923A@mollari.NetBSD.org>
Date: Mon, 14 Sep 2020 21:10:46 +0000 (UTC)
From: rajeev_v_pillai@yahoo.com
Reply-To: rajeev_v_pillai@yahoo.com
To: gnats-bugs@NetBSD.org
Subject: col(1): no output if input does not have newlines
X-Send-Pr-Version: www-1.0

>Number:         55660
>Category:       bin
>Synopsis:       col(1): no output if input does not have newlines
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 14 21:15:00 +0000 2020
>Last-Modified:  Sat Oct 31 06:15:01 +0000 2020
>Originator:     Rajeev Pillai
>Release:        9.0_STABLE
>Organization:
>Environment:
NetBSD x202e.localdomain 9.0_STABLE NetBSD 9.0_STABLE (GENERIC) #0: Fri Sep  4 18:54:33 UTC 2020  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
If the input supplied to col(1) does not have any newline characters,
then col(1) displays no output:

$ printf 'hello\vworld' | col
$ printf 'hello\rworld\r1\r2\r3\r4' | col

>How-To-Repeat:
See above.
>Fix:
diff -urN a/col.c b/col.c
--- a/col.c	2014-10-18 14:56:14.000000000 +0000
+++ b/col.c	2020-09-14 14:34:10.721099425 +0000
@@ -300,8 +300,6 @@
 			l->l_max_col = cur_col;
 		cur_col++;
 	}
-	if (max_line == 0)
-		exit(EXIT_SUCCESS);	/* no lines, so just exit */

 	/* goto the last line that had a character on it */
 	for (; l->l_next; l = l->l_next)

>Audit-Trail:
From: "Rajeev V. Pillai" <rajeev_v_pillai@yahoo.com>
To: "gnats-bugs@NetBSD.org" <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: bin/55660
Date: Sat, 10 Oct 2020 20:31:52 +0000 (UTC)

 Fixed in FreeBSD-current:

 https://svnweb.freebsd.org/base?view=revision&revision=366577

From: "Rajeev V. Pillai" <rajeev_v_pillai@yahoo.com>
To: "gnats-bugs@netbsd.org" <gnats-bugs@netbsd.org>
Cc: 
Subject: Re: bin/55660: col(1): no output if input does not have newlines
Date: Sat, 31 Oct 2020 04:12:12 +0000 (UTC)

 On Tuesday, 15 September 2020, 02:45:03 GMT+5:30, <gnats-admin@netbsd.org> wrote: 

 > Thank you very much for your problem report.
 > It has the internal identification `bin/55660'.

 Fixed also in FreeBSD 12.2-STABLE:

 https://svnweb.freebsd.org/base?view=revision&revision=367171

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.