NetBSD Problem Report #53837

From mike@fth-devel.net  Sun Jan  6 00:49:36 2019
Return-Path: <mike@fth-devel.net>
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 932297A10D
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  6 Jan 2019 00:49:36 +0000 (UTC)
Message-Id: <alpine.NEB.2.21.1901060142510.5409@pumpkin.fth-devel.net>
Date: Sun, 6 Jan 2019 01:49:14 +0100 (CET)
From: Michael Scholz <mike@fth-devel.net>
To: gnats-bugs@NetBSD.org
Subject: csh in current has superfluous fprintf

>Number:         53837
>Category:       bin
>Synopsis:       src/bin/csh/func.c from current has a superfluous fprintf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 06 00:50:00 +0000 2019
>Closed-Date:    Mon Jan 14 06:22:45 +0000 2019
>Last-Modified:  Mon Jan 14 06:22:45 +0000 2019
>Originator:     Michael Scholz
>Release:        NetBSD 8.99.30
>Organization:
>Environment:
System: NetBSD pumpkin.fth-devel.net 8.99.30 NetBSD 8.99.30 (PUMPKIN) #0: Sat Jan 5 22:45:18 CET 2019 toor@pumpkin.fth-devel.net:/stm/obj/usr/src/sys/arch/amd64/compile/PUMPKIN amd64
Architecture: x86_64
Machine: amd64
>Description:
In C-Shell scripts (/bin/csh) switch statements are printing their
case strings.  This slipped in CVS-current between Friday, 2018-01-04,
and Saturday, 2018-01-05.  It looks like a not removed debug fprintf.

>How-To-Repeat:
% cat test.csh
#!/bin/csh

set opts = `getopt "a" $argv`

foreach x ($opts)
 	switch ($x)
 	case -a:
 		echo "a found"
 		shift
 		breaksw
 	endsw
end

The script produces:
% ./test.csh
-a

>Fix:

Index: func.c
===================================================================
RCS file: /cvsroot/src/bin/csh/func.c,v
retrieving revision 1.42
diff -p -u -r1.42 func.c
--- func.c	5 Jan 2019 16:54:00 -0000	1.42
+++ func.c	6 Jan 2019 00:07:17 -0000
@@ -619,7 +619,6 @@ search(int type, int level, Char *goal)
  	    if (lastchr(aword) == ':')
  		aword[Strlen(aword) - 1] = 0;
  	    cp = strip(Dfix1(aword));
-	    fprintf(cshout, "%s\n", short2str(cp));
  	    if (Gmatch(goal, cp))
  		level = -1;
  	    free(cp);

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53837 CVS commit: src/bin/csh
Date: Sat, 5 Jan 2019 20:22:51 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Sun Jan  6 01:22:50 UTC 2019

 Modified Files:
 	src/bin/csh: func.c

 Log Message:
 PR/53837: Michael Scholz: src/bin/csh/func.c from current has a superfluous
 fprintf


 To generate a diff of this commit:
 cvs rdiff -u -r1.42 -r1.43 src/bin/csh/func.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: dholland@NetBSD.org
State-Changed-When: Mon, 14 Jan 2019 06:22:45 +0000
State-Changed-Why:
fixed, thanks


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.