Hello,
The following patch fixes ksh autocomplete support for files within
directories containing []:`$= characters. This also fixes the problem
ray@ was experiencing with the back quotes in PR user/6006.
Matthew
Index: edit.c
===================================================================
RCS file: /cvs/src/bin/ksh/edit.c,v
retrieving revision 1.33
diff -u edit.c
--- edit.c 2 Aug 2007 10:50:25 -0000 1.33
+++ edit.c 4 Apr 2010 01:29:09 -0000
@@ -391,6 +391,16 @@
continue;
}
+ /* except for characters that must be quoted by the lexer */
+ if (escaping) {
+ switch (toglob[i]) {
+ case '[':
+ case '`':
+ case '$':
+ toglob[idx++] = '\\';
+ }
+ }
+
toglob[idx] = toglob[i];
idx++;
if (escaping) escaping = 0;
@@ -847,7 +857,7 @@
int rval=0;
for (add = 0, wlen = len; wlen - add > 0; add++) {
- if (strchr("\\$(){}[]?*&;#|<>\"'`", s[add]) || strchr(ifs,
s[add])) {
+ if (strchr("\\$(){}[]?*&;#|<>\"'=`:", s[add]) || strchr(ifs,
s[add])) {
if (putbuf_func(s, add) != 0) {
rval = -1;
break;
Index: lex.c
===================================================================
RCS file: /cvs/src/bin/ksh/lex.c,v
retrieving revision 1.44
diff -u lex.c
--- lex.c 3 Jul 2008 17:52:08 -0000 1.44
+++ lex.c 4 Apr 2010 01:29:09 -0000
@@ -289,7 +289,9 @@
c = getsc();
switch (c) {
case '\\':
- case '$': case '`':
+ case '$':
+ case '`':
+ case '[':
*wp++ = QCHAR, *wp++ = c;
break;
case '"':