On Sun, Apr 04, 2010 at 02:23:35PM +0930, Matthew Haub wrote:
> Hello,
>
> On Sun, Apr 04, 2010 at 11:41:56AM +0930, Matthew Haub wrote:
> > 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.
>
> Here's the same patch with an unnecessary if statement removed.
>
> 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 04:07:00 -0000
> @@ -391,9 +391,20 @@
> continue;
> }
>
> + /* except for characters that must be quoted to the lexer */
> + if (escaping) {
> + escaping = 0;
> +
> + switch (toglob[i]) {
> + case '[':
> + case '`':
> + case '$':
> + toglob[idx++] = '\\';
> + }
Above switch statement doesn't conform with style(9). Also
it is missing "break;".
Better this way:
+ switch (toglob[i]) {
+ case '[':
+ case '`':
+ case '$':
+ toglob[idx++] = '\\';
+ break;
+ }
--patrick