diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-01-09 08:37:45 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-01-09 08:37:45 +0000 |
commit | 22da1cdae695e61c76eb6c086ebad9a347e9da67 (patch) | |
tree | d20a030a6447bb7809f59e3c31793d44b900c248 /usr.bin | |
parent | a9976c5279dadf9587d91619a6579a868c940c2f (diff) |
Accept empty command, from Matthew R. Dempsky; ok deraadt@ millert@
Diffstat (limited to 'usr.bin')
-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; |