NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/53837: 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:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 06 00:50:00 +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@localhost:/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);



Home | Main Index | Thread Index | Old Index