1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 22:11:54 +02:00

quote brace-strings (12113)

This commit is contained in:
Sven Wischnowsky 2000-06-29 06:59:00 +00:00
parent d38f54a928
commit 806e8aa6af
3 changed files with 20 additions and 10 deletions

View file

@ -1,3 +1,8 @@
2000-06-29 Sven Wischnowsky <wischnow@zsh.org>
* 12113: Completion/Core/_expand, Src/Zle/zle_tricky.c: quote
brace-strings
2000-06-28 Bart Schaefer <schaefer@zsh.org>
* 12112: Src/params.c: Don't make namedirs out of hash elements.

View file

@ -59,8 +59,9 @@ if [[ "$force" = *s* ]] ||
zstyle -T ":completion:${curcontext}:" substitute; then
[[ ! -o ignorebraces && "${#${exp}//[^\{]}" = "${#${exp}//[^\}]}" ]] &&
eval exp\=\( ${${(q)exp}:gs/\\{/\{/:gs/\\}/\}/} \)
exp=( ${(e)exp//\\[
]/ } )
exp=( ${${(e)exp//\\[
]/ }//(#b)([
])/\\$match[1]} )
else
exp=( ${exp:s/\\\$/\$} )
fi

View file

@ -1464,11 +1464,12 @@ get_comp_string(void)
lastbrbeg = new;
new->next = NULL;
new->str = ztrduppfx(bbeg, len);
new->str = dupstrpfx(bbeg, len);
new->str = ztrdup(bslashquote(new->str, NULL, instring));
untokenize(new->str);
new->pos = begi;
*dbeg = '\0';
new->qpos = strlen(quotename(predup, NULL));
new->qpos = strlen(bslashquote(predup, NULL, instring));
*dbeg = '{';
i -= len;
boffs -= len;
@ -1511,11 +1512,12 @@ get_comp_string(void)
brbeg = new;
lastbrbeg = new;
new->str = ztrduppfx(bbeg, len);
new->str = dupstrpfx(bbeg, len);
new->str = ztrdup(bslashquote(new->str, NULL, instring));
untokenize(new->str);
new->pos = begi;
*dbeg = '\0';
new->qpos = strlen(quotename(predup, NULL));
new->qpos = strlen(bslashquote(predup, NULL, instring));
*dbeg = '{';
i -= len;
boffs -= len;
@ -1547,7 +1549,8 @@ get_comp_string(void)
new->next = brend;
brend = new;
new->str = ztrduppfx(bbeg, len);
new->str = dupstrpfx(bbeg, len);
new->str = ztrdup(bslashquote(new->str, NULL, instring));
untokenize(new->str);
new->pos = dp - predup - len + 1;
new->qpos = len;
@ -1575,11 +1578,12 @@ get_comp_string(void)
brbeg = new;
lastbrbeg = new;
new->str = ztrduppfx(bbeg, len);
new->str = dupstrpfx(bbeg, len);
new->str = ztrdup(bslashquote(new->str, NULL, instring));
untokenize(new->str);
new->pos = begi;
*dbeg = '\0';
new->qpos = strlen(quotename(predup, NULL));
new->qpos = strlen(bslashquote(predup, NULL, instring));
*dbeg = '{';
boffs -= len;
strcpy(dbeg, dbeg + len);
@ -1594,7 +1598,7 @@ get_comp_string(void)
p = bp->pos;
l = bp->qpos;
bp->pos = strlen(predup + p + l);
bp->qpos = strlen(quotename(predup + p + l, NULL));
bp->qpos = strlen(bslashquote(predup + p + l, NULL, instring));
strcpy(predup + p, predup + p + l);
}
}