aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-11-05 00:13:27 -0600
committerRob Landley <rob@landley.net>2015-11-05 00:13:27 -0600
commit769341fdd7497683136d1a9ae08f6009dbad6c8c (patch)
tree8ea1c3c90d0a7c5e6814588e9f807a88a4633524 /toys
parent547c9167565cf8a2bba8bd79850889101866814a (diff)
downloadtoybox-769341fdd7497683136d1a9ae08f6009dbad6c8c.tar.gz
Fix sed bug where any ] right after [ was skipped, not just first one in range.
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/sed.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/sed.c b/toys/posix/sed.c
index 9d377cdb..a57891e5 100644
--- a/toys/posix/sed.c
+++ b/toys/posix/sed.c
@@ -718,7 +718,7 @@ static char *unescape_delimited_string(char **pstr, char *delim, int regex)
if (!*from) return 0;
// delimiter in regex character range doesn't count
- if (*from == '[') {
+ if (!mode && *from == '[') {
mode = '[';
if (from[1] == ']') *(to++) = *(from++);
} else if (mode && *from == ']') mode = 0;