summaryrefslogtreecommitdiff
path: root/Src/Zle/computil.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2006-02-13 11:06:21 +0000
committerWayne Davison <wayned@users.sourceforge.net>2006-02-13 11:06:21 +0000
commit5c8bb4944d669065a0ee5ede7e375b24553ad18b (patch)
tree4b2e93c41dcb3c0ce3306b726e74269f5d2a6279 /Src/Zle/computil.c
parenta6658fb9f6c4be686d1cdf356d713c2382912ea1 (diff)
downloadzsh-5c8bb4944d669065a0ee5ede7e375b24553ad18b.tar.gz
zsh-5c8bb4944d669065a0ee5ede7e375b24553ad18b.zip
Replaced a flawed look-behind algorithm for backslash detection
with one that looks forward (avoiding an accidental quoting of a char after a "\\" sequence).
Diffstat (limited to 'Src/Zle/computil.c')
-rw-r--r--Src/Zle/computil.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 8c1fa0800..6bc02e36d 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -3671,14 +3671,14 @@ bin_comptry(char *nam, char **args, UNUSED(Options ops), UNUSED(int func))
qqq = qq = dupstring(q);
while (*qqq) {
- if (qqq == qq || qqq[-1] != '\\') {
- if (*qqq == '{')
- *qqq = Inbrace;
- else if (*qqq == '}')
- *qqq = Outbrace;
- else if (*qqq == ',')
- *qqq = Comma;
- }
+ if (*qqq == '\\' && qqq[1])
+ qqq++;
+ else if (*qqq == '{')
+ *qqq = Inbrace;
+ else if (*qqq == '}')
+ *qqq = Outbrace;
+ else if (*qqq == ',')
+ *qqq = Comma;
qqq++;
}
tokenize(qq);