[BusyBox-cvs] busybox/editors sed.c,1.151,1.152

Glenn McGrath bug1 at busybox.net
Wed Oct 1 06:45:14 UTC 2003


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

Modified Files:
	sed.c 
Log Message:
Patch by Rob Landley, fix "newline after edit command"


Index: sed.c
===================================================================
RCS file: /var/cvs/busybox/editors/sed.c,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -d -r1.151 -r1.152
--- sed.c	1 Oct 2003 03:06:15 -0000	1.151
+++ sed.c	1 Oct 2003 06:45:11 -0000	1.152
@@ -176,8 +176,8 @@
 
 	while(i<len) {
 		if(string[i] == '\\') {
-			if(string[i+1] == from) {
-				*(dest++) = to;
+			if(!to || string[i+1] == from) {
+				*(dest++) = to ? to : string[i+1];
 				i+=2;
 				continue;
 			} else *(dest++)=string[i++];
@@ -403,6 +403,7 @@
 				("only a beginning address can be specified for edit commands");
 		while(isspace(*cmdstr)) cmdstr++;
 		sed_cmd->string = bb_xstrdup(cmdstr);
+		parse_escapes(sed_cmd->string,sed_cmd->string,strlen(cmdstr),0,0);
 		cmdstr += strlen(cmdstr);
 	/* handle file cmds: (r)ead */
 	} else if(strchr("rw", sed_cmd->cmd)) {




More information about the busybox-cvs mailing list