[git commit] sed: document where we are more liberal then GNU

Denys Vlasenko vda.linux at googlemail.com
Sun Jul 7 23:43:40 UTC 2013


commit: http://git.busybox.net/busybox/commit/?id=e93d15613e827db0d1a7ee7e251b7360bb7ab447
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 editors/sed.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/editors/sed.c b/editors/sed.c
index f8ca5d3..f90bc54 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -649,6 +649,12 @@ static void add_cmd(const char *cmdstr)
 		sed_cmd->cmd = *cmdstr++;
 		cmdstr = parse_cmd_args(sed_cmd, cmdstr);
 
+		/* cmdstr now points past args.
+		 * GNU sed requires a separator, if there are more commands,
+		 * else it complains "char N: extra characters after command".
+		 * Example: "sed 'p;d'". We also allow "sed 'pd'".
+		 */
+
 		/* Add the command to the command array */
 		*G.sed_cmd_tail = sed_cmd;
 		G.sed_cmd_tail = &sed_cmd->next;


More information about the busybox-cvs mailing list