-- 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)
+ /* check for negation */
+- if (ISMAGIC(p[0]) && ord(p[1]) == ORD('!')) {
++ if (ISMAGIC(p[0]) && (ord(p[1]) == ORD('!') || ord(p[1]) == ORD(NOT2))) {
+ p += 2;
+ negated = true;
+ }
+diff -ur mksh-56.orig/sh.h mksh-56/sh.h
+--- mksh-56.orig/sh.h 2017-08-12 22:10:26.325009789 +0200
++++ mksh-56/sh.h 2017-08-12 22:40:32.696009488 +0200
+@@ -550,6 +550,7 @@
+ */
+ #define MAGIC KSH_BEL /* prefix for *?[!{,} during expand */
+ #define ISMAGIC(c) (ord(c) == ORD(MAGIC))