NetBSD Problem Report #41880

From www@NetBSD.org  Wed Aug 12 19:57:07 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 6283E63C285
	for <gnats-bugs@gnats.netbsd.org>; Wed, 12 Aug 2009 19:57:07 +0000 (UTC)
Message-Id: <20090812195707.2FDCA63C284@www.NetBSD.org>
Date: Wed, 12 Aug 2009 19:57:07 +0000 (UTC)
From: gralph@post-ist-da.de
Reply-To: gralph@post-ist-da.de
To: gnats-bugs@NetBSD.org
Subject: extra spaces in pr(1) output
X-Send-Pr-Version: www-1.0

>Number:         41880
>Category:       bin
>Synopsis:       extra spaces in pr(1) output
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 12 20:00:00 +0000 2009
>Closed-Date:    Tue Mar 13 05:40:33 +0000 2012
>Last-Modified:  Tue Mar 13 05:40:33 +0000 2012
>Originator:     Ralph G
>Release:        NetBSD 5.0
>Organization:
>Environment:
NetBSD myname.net 5.0 NetBSD 5.0 (GENERIC) #0: Sun Apr 26 18:50:08 UTC 2009  builds@b6.netbsd.org:/home/builds/ab/netbsd-5-0-RELEASE/i386/200904260229Z-obj/home/builds/ab/netbsd-5-0-RELEASE/src/sys/arch/i386/compile/GENERIC i386 
>Description:
In case of multi column output pr(1) prints additional spaces between words.

>How-To-Repeat:
$ printf "123 456 789\nabc def ghi\n" | pr -t -2
123  456  789                       abc  def  ghi
   !!   !!                             !!   !!

>Fix:
hint: it seems the problem was introduced with the fix for PR 5797

>Release-Note:

>Audit-Trail:
From: Ralph G <gralph@post-ist-da.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/41880: extra spaces in pr(1) output
Date: Tue, 17 Nov 2009 20:44:28 +0100

 The following works for me:

 regards
 Ralph


 Index: pr.c
 ===================================================================
 RCS file: /cvsroot/src/usr.bin/pr/pr.c,v
 retrieving revision 1.20
 diff -u -r1.20 pr.c
 --- pr.c	13 Apr 2009 00:37:05 -0000	1.20
 +++ pr.c	17 Nov 2009 19:41:48 -0000
 @@ -1154,14 +1154,7 @@
  			/*
  			 * got a non space char; contract out spaces
  			 */
 -			while (ops < ips) {
 -				/*
 -				 * use one space if necessary
 -				 */
 -				if (ips - ops == 1) {
 -					putchar(' ');
 -					break;
 -				}
 +			while (ips - ops > 1) {
  				/*
  				 * use as many ochar as will fit
  				 */
 @@ -1206,14 +1199,7 @@
  		}

  		if (mor < 0) {
 -			while (ops < ips) {
 -				/*
 -				 * use one space if necessary
 -				 */
 -				if (ips - ops == 1) {
 -					putchar(' ');
 -					break;
 -				}
 +			while (ips - ops > 1) {
  				/*
  				 * use as many ochar as will fit
  				 */

From: "Jukka Ruohonen" <jruoho@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/41880 CVS commit: src
Date: Tue, 3 May 2011 08:36:16 +0000

 Module Name:	src
 Committed By:	jruoho
 Date:		Tue May  3 08:36:15 UTC 2011

 Modified Files:
 	src/distrib/sets/lists/tests: mi
 	src/etc/mtree: NetBSD.dist.tests
 	src/tests/usr.bin: Makefile
 Added Files:
 	src/tests/usr.bin/pr: Makefile d_basic.in d_basic.out t_basic.sh

 Log Message:
 Add a test for PR bin/41880.


 To generate a diff of this commit:
 cvs rdiff -u -r1.324 -r1.325 src/distrib/sets/lists/tests/mi
 cvs rdiff -u -r1.44 -r1.45 src/etc/mtree/NetBSD.dist.tests
 cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/Makefile
 cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/pr/Makefile \
     src/tests/usr.bin/pr/d_basic.in src/tests/usr.bin/pr/d_basic.out \
     src/tests/usr.bin/pr/t_basic.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/41880 CVS commit: src/usr.bin/pr
Date: Mon, 12 Mar 2012 14:06:24 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Mon Mar 12 18:06:24 UTC 2012

 Modified Files:
 	src/usr.bin/pr: pr.c

 Log Message:
 PR/41880: Ralph G. Previous fix for PR/5797 broke since space separator.


 To generate a diff of this commit:
 cvs rdiff -u -r1.21 -r1.22 src/usr.bin/pr/pr.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: jruoho@NetBSD.org
State-Changed-When: Tue, 13 Mar 2012 05:40:33 +0000
State-Changed-Why:

Fixed and fix confirmed by the test runs.



>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.