diff options
author | 2007-01-09 08:37:44 +0000 | |
---|---|---|
committer | 2007-01-09 08:37:44 +0000 | |
commit | 185c69583b3ef1e0f3f2b1ef74771a1f79f6c8ae (patch) | |
tree | b0b3de0ef18d8a514e03c7d96c95b16cf42c9618 | |
parent | add net.inet6.ip6.mforwarding which was forgotten when the variable was added. (diff) | |
download | wireguard-openbsd-185c69583b3ef1e0f3f2b1ef74771a1f79f6c8ae.tar.xz wireguard-openbsd-185c69583b3ef1e0f3f2b1ef74771a1f79f6c8ae.zip |
Accept empty command, from Matthew R. Dempsky; ok deraadt@ millert@
-rw-r--r-- | usr.bin/sed/compile.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c index 20f33f82a30..89172c0707f 100644 --- a/usr.bin/sed/compile.c +++ b/usr.bin/sed/compile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compile.c,v 1.22 2006/10/09 00:23:56 tedu Exp $ */ +/* $OpenBSD: compile.c,v 1.23 2007/01/09 08:37:44 otto Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. @@ -35,7 +35,7 @@ #ifndef lint /* from: static char sccsid[] = "@(#)compile.c 8.2 (Berkeley) 4/28/95"; */ -static const char rcsid[] = "$OpenBSD: compile.c,v 1.22 2006/10/09 00:23:56 tedu Exp $"; +static const char rcsid[] = "$OpenBSD: compile.c,v 1.23 2007/01/09 08:37:44 otto Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -161,8 +161,12 @@ compile_stream(struct s_command **link) } semicolon: EATSPACE(); - if (p && (*p == '#' || *p == '\0')) + if (*p == '#' || *p == '\0') continue; + if (*p == ';') { + p++; + goto semicolon; + } *link = cmd = xmalloc(sizeof(struct s_command)); link = &cmd->next; cmd->nonsel = cmd->inrange = 0; |