new 'echo'

John Ruschmeyer john at moncol.UUCP
Thu Apr 18 11:12:21 AEST 1985


As posted, the new 'echo' program has several bugs all
stemming from missing 'break' statements in the loop which
parses the arguments. The only visible bug, however, is
that the '-n' option will also select the '-q' option and
nothing will be printed.

Also, the '-q' option should cause the '-n' option to be
selected by default. This allows the program to be used to
create an empty file, as in:

	echo -q foo >newfile

The following diff shows the corrections which will take
care of both problems:

16,18c16,18
< 				case 'n': nflg++;
< 				case 'q': qflg++;
< 				case 'r': rflg++;
---
> 				case 'n': nflg++; break;
> 				case 'q': qflg++; nflg++; break;
> 				case 'r': rflg++; break;


-- 
Name:		John Ruschmeyer
US Mail:	Monmouth College, W. Long Branch, NJ 07764
Phone:		(201) 222-6600 x366
UUCP:		...!vax135!petsd!moncol!john	...!princeton!moncol!john
						   ...!pesnta!moncol!john
Silly Quote:
		"Ah, but what is a dream but reality without a backbone?"



More information about the Comp.sources.bugs mailing list