From e465cc43824aed64e7a4c3a4a7e44a0e68a23b10 Mon Sep 17 00:00:00 2001 From: tjr Date: Tue, 30 Jul 2002 14:07:30 +0000 Subject: Ignore leading semicolons on commands; required by SUSv3. Obtained from: NetBSD (kleink, Aymeric Vincent) --- usr.bin/sed/compile.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c index 8265ff8..a97e01d 100644 --- a/usr.bin/sed/compile.c +++ b/usr.bin/sed/compile.c @@ -172,8 +172,14 @@ compile_stream(link) } semicolon: EATSPACE(); - if (p && (*p == '#' || *p == '\0')) - continue; + if (p) { + if (*p == '#' || *p == '\0') + continue; + else if (*p == ';') { + p++; + goto semicolon; + } + } if ((*link = cmd = malloc(sizeof(struct s_command))) == NULL) err(1, "malloc"); link = &cmd->next; -- cgit v1.1