From 96199e6b701cfd47d391b0bc4fc2021e8099fc7d Mon Sep 17 00:00:00 2001 From: dds Date: Sun, 20 Sep 2009 14:11:33 +0000 Subject: Allow [ to be used as a delimiter. Pointed by: Marius Strobl Obtained from: Apple --- usr.bin/sed/compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr.bin/sed/compile.c') diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c index 53e2af7..a51a314 100644 --- a/usr.bin/sed/compile.c +++ b/usr.bin/sed/compile.c @@ -387,7 +387,7 @@ compile_delimited(char *p, char *d) errx(1, "%lu: %s: newline can not be used as a string delimiter", linenum, fname); while (*p) { - if (*p == '[') { + if (*p == '[' && *p != c) { if ((d = compile_ccl(&p, d)) == NULL) errx(1, "%lu: %s: unbalanced brackets ([])", linenum, fname); continue; -- cgit v1.1