diff options
author | tjr <tjr@FreeBSD.org> | 2002-07-30 14:07:30 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-07-30 14:07:30 +0000 |
commit | e465cc43824aed64e7a4c3a4a7e44a0e68a23b10 (patch) | |
tree | 0175ce9f9701fe3ba34337b3c199844fe10eedb0 /usr.bin/sed | |
parent | 9b13f71feea604d9bc5c7ef9513249394d8dc259 (diff) | |
download | FreeBSD-src-e465cc43824aed64e7a4c3a4a7e44a0e68a23b10.zip FreeBSD-src-e465cc43824aed64e7a4c3a4a7e44a0e68a23b10.tar.gz |
Ignore leading semicolons on commands; required by SUSv3.
Obtained from: NetBSD (kleink, Aymeric Vincent)
Diffstat (limited to 'usr.bin/sed')
-rw-r--r-- | usr.bin/sed/compile.c | 10 |
1 files changed, 8 insertions, 2 deletions
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; |