summaryrefslogtreecommitdiff
path: root/Src/Zle/complete.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-10-05 21:53:26 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-10-05 21:53:26 +0000
commit289b14113b1675b7b8d844b1f41aff1e2f3a5146 (patch)
tree89020810aae313b94a061156efcc557d7251ba16 /Src/Zle/complete.c
parent298a8b8130bd3f515c1aa9f8fcd901c878cbb668 (diff)
downloadzsh-289b14113b1675b7b8d844b1f41aff1e2f3a5146.tar.gz
zsh-289b14113b1675b7b8d844b1f41aff1e2f3a5146.zip
22819: improved internal use of string quotation,
plus completion bug fix with RCQUOTES
Diffstat (limited to 'Src/Zle/complete.c')
-rw-r--r--Src/Zle/complete.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index 46e9a06d8..a73d3cf14 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -992,6 +992,8 @@ static const struct gsu_scalar unambig_pos_gsu =
{ get_unambig_pos, nullstrsetfn, compunsetfn };
static const struct gsu_scalar insert_pos_gsu =
{ get_insert_pos, nullstrsetfn, compunsetfn };
+static const struct gsu_scalar compqstack_gsu =
+{ get_compqstack, nullstrsetfn, compunsetfn };
static const struct gsu_integer compvarinteger_gsu =
{ intvargetfn, intvarsetfn, compunsetfn };
@@ -1047,7 +1049,7 @@ static struct compparam compkparams[] = {
{ "old_insert", PM_SCALAR, VAL(compoldins), NULL },
{ "vared", PM_SCALAR, VAL(compvared), NULL },
{ "list_lines", PM_INTEGER | PM_READONLY, NULL, GSU(listlines_gsu) },
- { "all_quotes", PM_SCALAR | PM_READONLY, VAL(compqstack), NULL },
+ { "all_quotes", PM_SCALAR | PM_READONLY, NULL, GSU(compqstack_gsu) },
{ "ignored", PM_INTEGER | PM_READONLY, VAL(compignored), NULL },
{ NULL, 0, NULL, NULL }
};
@@ -1223,6 +1225,26 @@ get_insert_pos(UNUSED(Param pm))
}
/**/
+static char *
+get_compqstack(UNUSED(Param pm))
+{
+ char *p, *ptr, *cqp;
+
+ if (!compqstack) /* TODO: don't think this can happen... */
+ return "";
+
+ ptr = p = zhalloc(2*strlen(compqstack)+1);
+
+ for (cqp = compqstack; *cqp; cqp++) {
+ char *str = comp_quoting_string(*cqp);
+ *ptr++ = *str;
+ }
+ *ptr = '\0';
+
+ return p;
+}
+
+/**/
static void
compunsetfn(Param pm, int exp)
{