diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-12-07 14:45:41 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-12-07 14:45:41 +0000 |
commit | d398add394cdeebd144963e9a8638d67993d591a (patch) | |
tree | 5c62680cdfc0b7637982c05c5ef03b8cba117f8b /usr.bin | |
parent | 4aba39df184222ac488dbfea1c26562121fb4f29 (diff) |
As an extension to POSIX, for consistency with our behaviour for
the "b" and "t" commands with a label, and for compatibility with
GNU sed, also accept ";" followed by another command after "b"
and "t" commands without a label: branch to the end of the script
instead of erroring out. Parsing is unchanged.
Missing feature reported by Lars dot Nooden at gmail dot com on bugs@.
OK martijn@ millert@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/sed/compile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c index 64e31cd9b44..1ed9f979d12 100644 --- a/usr.bin/sed/compile.c +++ b/usr.bin/sed/compile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compile.c,v 1.49 2018/08/14 18:10:09 schwarze Exp $ */ +/* $OpenBSD: compile.c,v 1.50 2018/12/07 14:45:40 schwarze Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. @@ -284,7 +284,7 @@ nonsel: /* Now parse the command */ case BRANCH: /* b t */ p++; EATSPACE(); - if (*p == '\0') + if (*p == '\0' || *p == ';') cmd->t = NULL; else cmd->t = duptoeol(p, "branch", &p); |