diff -ur mksh-40.org//eval.c mksh-40/eval.c --- mksh-40.org//eval.c 2011-06-12 16:45:57.000000000 +0200 +++ mksh-40/eval.c 2011-07-07 18:27:58.891492090 +0200 @@ -887,6 +887,7 @@ switch (c) { case '[': case '!': + case NOT2: case '-': case ']': /* diff -ur mksh-40.org//misc.c mksh-40/misc.c --- mksh-40.org//misc.c 2011-06-12 16:45:58.000000000 +0200 +++ mksh-40/misc.c 2011-07-07 18:28:39.015826686 +0200 @@ -843,7 +843,7 @@ bool notp, found = false; const unsigned char *orig_p = p; - if ((notp = tobool(ISMAGIC(*p) && *++p == '!'))) + if ((notp = tobool(ISMAGIC(*p) && (*++p == '!' || *p == NOT2)))) p++; do { c = *p++; diff -ur mksh-40.org//sh.h mksh-40/sh.h --- mksh-40.org//sh.h 2011-06-12 16:59:09.000000000 +0200 +++ mksh-40/sh.h 2011-07-07 18:29:16.346761511 +0200 @@ -380,5 +380,6 @@ #define MAGIC (7) /* prefix for *?[!{,} during expand */ #define ISMAGIC(c) ((unsigned char)(c) == MAGIC) +#define NOT2 '^' #define LINE 4096 /* input line size */ diff -ur mksh-40.org//tree.c mksh-40/tree.c --- mksh-40.org//tree.c 2011-05-29 04:19:21.000000000 +0200 +++ mksh-40/tree.c 2011-07-07 18:30:12.088149284 +0200 @@ -289,7 +289,7 @@ case CHAR: c = *wp++; if ((opmode & WDS_MAGIC) && - (ISMAGIC(c) || c == '[' || c == '!' || + (ISMAGIC(c) || c == '[' || c == '!' || c == NOT2 || c == '-' || c == ']' || c == '*' || c == '?')) shf_putc(MAGIC, shf); shf_putc(c, shf);