Patch by Rob Landley, fix "newline after edit command"
diff --git a/editors/sed.c b/editors/sed.c
index 6452a32..3d6d72c 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -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)) {