-/* $OpenBSD: eval.c,v 1.45 2015/10/19 14:42:16 mmcc Exp $ */
+/* $OpenBSD: eval.c,v 1.46 2015/10/19 17:15:53 mmcc Exp $ */
/*
* Expansion - quoting, separation, substitution, globbing
if (!quote)
switch (c) {
case '[':
- case NOT:
+ case '!':
case '-':
case ']':
/* For character classes - doesn't hurt
if (*p == '[') {
char *q = p + 1;
- if (ISMAGIC(*q) && q[1] == NOT)
+ if (ISMAGIC(*q) && q[1] == '!')
q += 2;
if (ISMAGIC(*q) && q[1] == ']')
q += 2;
-/* $OpenBSD: misc.c,v 1.49 2015/10/19 14:42:16 mmcc Exp $ */
+/* $OpenBSD: misc.c,v 1.50 2015/10/19 17:15:53 mmcc Exp $ */
/*
* Miscellaneous functions
if (!in_bracket) {
saw_glob = 1;
in_bracket = 1;
- if (ISMAGIC(p[1]) && p[2] == NOT)
+ if (ISMAGIC(p[1]) && p[2] == '!')
p += 2;
if (ISMAGIC(p[1]) && p[2] == ']')
p += 2;
int c, d, rv, not, found = 0;
const unsigned char *orig_p = p;
- if ((not = (ISMAGIC(*p) && *++p == NOT)))
+ if ((not = (ISMAGIC(*p) && *++p == '!')))
p++;
do {
/* check for POSIX character class (e.g. [[:alpha:]]) */
-/* $OpenBSD: sh.h,v 1.45 2015/10/19 17:10:53 mmcc Exp $ */
+/* $OpenBSD: sh.h,v 1.46 2015/10/19 17:15:53 mmcc Exp $ */
/*
* Public Domain Bourne/Korn shell
*/
#define MAGIC (7) /* prefix for *?[!{,} during expand */
#define ISMAGIC(c) ((unsigned char)(c) == MAGIC)
-#define NOT '!' /* might use ^ (ie, [!...] vs [^..]) */
#define LINE 2048 /* input line size */
#define PATH 1024 /* pathname size (todo: PATH_MAX/pathconf()) */