Hello,

On Sat, Apr 03, 2010 at 11:33:56PM -0700, patrick keshishian wrote:
> Above switch statement doesn't conform with style(9). Also
> it is missing "break;".

Here is the updated patch conforming to style(9).

Thank you,
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 06:57:45 -0000
@@ -391,9 +391,21 @@
                        continue;
                }
 
+               /* except for characters that must be quoted by the lexer */
+               if (escaping) {
+                       escaping = 0;
+
+                       switch (toglob[i]) {
+                       case '[':
+                       case '`':
+                       case '$':
+                               toglob[idx++] = '\\';
+                               break;
+                       }
+               }
+
                toglob[idx] = toglob[i];
                idx++;
-               if (escaping) escaping = 0;
        }
        toglob[idx] = '\0';
 
@@ -847,7 +859,8 @@
        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 06:57:45 -0000
@@ -289,7 +289,9 @@
                                c = getsc();
                                switch (c) {
                                case '\\':
-                               case '$': case '`':
+                               case '$':
+                               case '`':
+                               case '[':
                                        *wp++ = QCHAR, *wp++ = c;
                                        break;
                                case '"':

Reply via email to