summaryrefslogtreecommitdiff
path: root/bin/sh/mksyntax.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1996-10-20 00:55:12 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1996-10-20 00:55:12 +0000
commit8414ed88be8de5352141730c176d30301d6700b4 (patch)
tree44a7f767c70131fb1d09f8a151860fee4e22ae5f /bin/sh/mksyntax.c
parent78d30b21a3fa6e2f7d7fb077246e1e015a2dafdf (diff)
Sync with NetBSD. Adds better POSIX compliance amongst others.
Diffstat (limited to 'bin/sh/mksyntax.c')
-rw-r--r--bin/sh/mksyntax.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/sh/mksyntax.c b/bin/sh/mksyntax.c
index 5506ba70623..7b01c6e949a 100644
--- a/bin/sh/mksyntax.c
+++ b/bin/sh/mksyntax.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mksyntax.c,v 1.3 1996/09/15 22:58:08 millert Exp $ */
+/* $OpenBSD: mksyntax.c,v 1.4 1996/10/20 00:54:55 millert Exp $ */
/* $NetBSD: mksyntax.c,v 1.11 1995/05/11 21:29:37 christos Exp $ */
/*-
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)mksyntax.c 8.2 (Berkeley) 5/4/95";
#else
-static char rcsid[] = "$OpenBSD: mksyntax.c,v 1.3 1996/09/15 22:58:08 millert Exp $";
+static char rcsid[] = "$OpenBSD: mksyntax.c,v 1.4 1996/10/20 00:54:55 millert Exp $";
#endif
#endif /* not lint */
@@ -172,6 +172,7 @@ main(argc, argv)
}
fputs("#include <sys/cdefs.h>\n", hfile);
+ fputs("#include <ctype.h>\n", hfile);
/* Generate the #define statements in the header file */
fputs("/* Syntax classes */\n", hfile);
@@ -351,9 +352,9 @@ print(name)
static char *macro[] = {
"#define is_digit(c)\t((is_type+SYNBASE)[c] & ISDIGIT)",
- "#define is_alpha(c)\t((is_type+SYNBASE)[c] & (ISUPPER|ISLOWER))",
- "#define is_name(c)\t((is_type+SYNBASE)[c] & (ISUPPER|ISLOWER|ISUNDER))",
- "#define is_in_name(c)\t((is_type+SYNBASE)[c] & (ISUPPER|ISLOWER|ISUNDER|ISDIGIT))",
+ "#define is_alpha(c)\t((c) != PEOF && ((c) < CTLESC || (c) > CTLENDARI) && isalpha((unsigned char) (c)))",
+ "#define is_name(c)\t((c) != PEOF && ((c) < CTLESC || (c) > CTLENDARI) && ((c) == '_' || isalpha((unsigned char) (c))))",
+ "#define is_in_name(c)\t((c) != PEOF && ((c) < CTLESC || (c) > CTLENDARI) && ((c) == '_' || isalnum((unsigned char) (c))))",
"#define is_special(c)\t((is_type+SYNBASE)[c] & (ISSPECL|ISDIGIT))",
NULL
};