summaryrefslogtreecommitdiffstats
path: root/usr.bin/sed/compile.c
diff options
context:
space:
mode:
authornaddy <naddy@openbsd.org>2010-07-01 17:02:02 +0000
committernaddy <naddy@openbsd.org>2010-07-01 17:02:02 +0000
commitfc40af3fbe2deebacfbd8c5749c6bcc16bc2392c (patch)
tree8880cd8a6395f82c671693fe140fb08a3f4ef4b2 /usr.bin/sed/compile.c
parentLearn wsconsctl to handle more than the first keyboard, mouse and display. (diff)
downloadwireguard-openbsd-fc40af3fbe2deebacfbd8c5749c6bcc16bc2392c.tar.xz
wireguard-openbsd-fc40af3fbe2deebacfbd8c5749c6bcc16bc2392c.zip
Allow [ to be used as a delimiter.
From FreeBSD; ok millert@ halex@
Diffstat (limited to 'usr.bin/sed/compile.c')
-rw-r--r--usr.bin/sed/compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c
index f8f8a05be10..4b5b33b95db 100644
--- a/usr.bin/sed/compile.c
+++ b/usr.bin/sed/compile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: compile.c,v 1.31 2009/10/27 23:59:43 deraadt Exp $ */
+/* $OpenBSD: compile.c,v 1.32 2010/07/01 17:02:02 naddy Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -357,7 +357,7 @@ compile_delimited(char *p, char *d)
else if (c == '\n')
err(COMPILE, "newline can not be used as a string delimiter");
while (*p) {
- if (*p == '[') {
+ if (*p == '[' && *p != c) {
if ((d = compile_ccl(&p, d)) == NULL)
err(COMPILE, "unbalanced brackets ([])");
continue;