From d398add394cdeebd144963e9a8638d67993d591a Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 7 Dec 2018 14:45:41 +0000 Subject: 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@ --- usr.bin/sed/compile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin') 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); -- cgit v1.2.3