From 3795e667c5d6dc89460127ad95a21a9756a76187 Mon Sep 17 00:00:00 2001 From: tg Date: Fri, 23 Mar 2012 20:07:13 +0000 Subject: [PATCH] =?UTF-8?q?drop=20use=20of=20the=20NOT=20macro,=20[^foo]?= =?UTF-8?q?=20=E2=89=A0=20[!foo]=20anyway,=20and=20we=E2=80=99re=20not=20g?= =?UTF-8?q?onna=20change=20that?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eval.c | 4 ++-- misc.c | 6 +++--- sh.h | 3 +-- tree.c | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/eval.c b/eval.c index bb7c2ae..13594a1 100644 --- a/eval.c +++ b/eval.c @@ -22,7 +22,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.111 2011/12/16 20:03:12 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.112 2012/03/23 20:07:10 tg Exp $"); /* * string expansion @@ -896,7 +896,7 @@ expand(const char *cp, /* input word */ if (!quote) switch (c) { case '[': - case NOT: + case '!': case '-': case ']': /* diff --git a/misc.c b/misc.c index 102dd05..92a00ca 100644 --- a/misc.c +++ b/misc.c @@ -30,7 +30,7 @@ #include #endif -__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.182 2012/01/04 22:38:33 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.183 2012/03/23 20:07:11 tg Exp $"); /* type bits for unsigned char */ unsigned char chtypes[UCHAR_MAX + 1]; @@ -645,7 +645,7 @@ has_globbing(const char *xp, const char *xpe) if (!in_bracket) { saw_glob = true; in_bracket = true; - if (ISMAGIC(p[1]) && p[2] == NOT) + if (ISMAGIC(p[1]) && p[2] == '!') p += 2; if (ISMAGIC(p[1]) && p[2] == ']') p += 2; @@ -824,7 +824,7 @@ cclass(const unsigned char *p, int sub) int c, d, notp, found = 0; const unsigned char *orig_p = p; - if ((notp = (ISMAGIC(*p) && *++p == NOT))) + if ((notp = (ISMAGIC(*p) && *++p == '!'))) p++; do { c = *p++; diff --git a/sh.h b/sh.h index 0f20462..c084146 100644 --- a/sh.h +++ b/sh.h @@ -152,7 +152,7 @@ #endif #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.523 2012/03/23 19:38:12 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.524 2012/03/23 20:07:11 tg Exp $"); #endif #define MKSH_VERSION "R40 2012/03/03" @@ -374,7 +374,6 @@ extern int wcwidth(__WCHAR_TYPE__); */ #define MAGIC (7) /* prefix for *?[!{,} during expand */ #define ISMAGIC(c) ((unsigned char)(c) == MAGIC) -#define NOT '!' /* might use ^ (ie, [!...] vs [^..]) */ #define LINE 4096 /* input line size */ diff --git a/tree.c b/tree.c index 739bbcd..bf1bc43 100644 --- a/tree.c +++ b/tree.c @@ -23,7 +23,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/tree.c,v 1.56 2012/02/06 17:42:24 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/tree.c,v 1.57 2012/03/23 20:07:13 tg Exp $"); #define INDENT 8 @@ -291,7 +291,7 @@ wdvarput(struct shf *shf, const char *wp, int quotelevel, int opmode) case CHAR: c = *wp++; if ((opmode & WDS_MAGIC) && - (ISMAGIC(c) || c == '[' || c == NOT || + (ISMAGIC(c) || c == '[' || c == '!' || c == '-' || c == ']' || c == '*' || c == '?')) shf_putc(MAGIC, shf); shf_putc(c, shf);