[BusyBox-cvs] busybox/editors sed.c,1.143,1.144

Glenn McGrath bug1 at busybox.net
Mon Sep 15 06:12:57 UTC 2003


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

Modified Files:
	sed.c 
Log Message:
A test and fix for the sed 'n' command


Index: sed.c
===================================================================
RCS file: /var/cvs/busybox/editors/sed.c,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -d -r1.143 -r1.144
--- sed.c	15 Sep 2003 05:42:05 -0000	1.143
+++ sed.c	15 Sep 2003 06:12:53 -0000	1.144
@@ -985,11 +985,19 @@
 					next_line = NULL;
 					break;
 				case 'n':	/* Read next line from input */
+					if (!be_quiet) {
+						puts(pattern_space);
+					}
 					if (next_line) {
 						free(pattern_space);
 						pattern_space = next_line;
 						next_line = bb_get_chomped_line_from_file(file);
 						linenum++;
+					} else {
+						/* Jump to end of script and exist */
+						deleted = 1;
+						free(next_line);
+						next_line = NULL;
 					}
 					break;
 				case 'N':	/* Append the next line to the current line */




More information about the busybox-cvs mailing list