[BusyBox-cvs] busybox/editors sed.c,1.125,1.126

Glenn McGrath bug1 at busybox.net
Wed Apr 9 15:26:17 UTC 2003


Update of /var/cvs/busybox/editors
In directory winder:/tmp/cvs-serv24197/editors

Modified Files:
	sed.c 
Log Message:
Fix the sed 'r' command


Index: sed.c
===================================================================
RCS file: /var/cvs/busybox/editors/sed.c,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -d -r1.125 -r1.126
--- sed.c	9 Apr 2003 07:51:43 -0000	1.125
+++ sed.c	9 Apr 2003 15:26:14 -0000	1.126
@@ -443,7 +443,6 @@
 	filenamelen = strcspn(&filecmdstr[idx], semicolon_whitespace);
 	sed_cmd->filename = xmalloc(filenamelen + 1);
 	safe_strncpy(sed_cmd->filename, &filecmdstr[idx], filenamelen + 1);
-
 	return idx + filenamelen;
 }
 
@@ -996,10 +995,10 @@
 				case 'r':{
 					FILE *outfile;
 
-					puts(pattern_space);
 					outfile = fopen(sed_cmd->filename, "r");
-					if (outfile)
+					if (outfile) {
 						bb_xprint_and_close_file(outfile);
+					}
 					/* else if we couldn't open the output file,
 					 * no biggie, just don't print anything */
 					altered++;



More information about the busybox-cvs mailing list