summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2010-07-01 17:02:03 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2010-07-01 17:02:03 +0000
commit3269b215277e7b004ef6c5cb1b64da4552cc625c (patch)
treea1c15efe9502eba9c62f6ff880bf07b54b76f7d8 /usr.bin
parent4375a386c1c72d45d24234a7738742e4cfcb6ecc (diff)
Allow [ to be used as a delimiter.
From FreeBSD; ok millert@ halex@
Diffstat (limited to 'usr.bin')
-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;