diff options
author | stefanf <stefanf@FreeBSD.org> | 2005-08-13 15:47:13 +0000 |
---|---|---|
committer | stefanf <stefanf@FreeBSD.org> | 2005-08-13 15:47:13 +0000 |
commit | d7c6f147cb721cf5c23b029b3d3bdaffb3909af4 (patch) | |
tree | 85dd677e248473e0c5871b6775faa03857417f5e /bin/sh/mksyntax.c | |
parent | e4a640448d3528aef497b7d29e3caaff29c8b2e2 (diff) | |
download | FreeBSD-src-d7c6f147cb721cf5c23b029b3d3bdaffb3909af4.zip FreeBSD-src-d7c6f147cb721cf5c23b029b3d3bdaffb3909af4.tar.gz |
Put the comparison with PEOF into a new macro is_eof(). Don't use it if the
character comes from a string.
Diffstat (limited to 'bin/sh/mksyntax.c')
-rw-r--r-- | bin/sh/mksyntax.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/sh/mksyntax.c b/bin/sh/mksyntax.c index 505c359..6966ae0 100644 --- a/bin/sh/mksyntax.c +++ b/bin/sh/mksyntax.c @@ -343,9 +343,10 @@ print(char *name) static char *macro[] = { "#define is_digit(c)\t((is_type+SYNBASE)[c] & ISDIGIT)", - "#define is_alpha(c)\t((c) != PEOF && ((c) < CTLESC || (c) > CTLQUOTEMARK) && isalpha((unsigned char) (c)))", - "#define is_name(c)\t((c) != PEOF && ((c) < CTLESC || (c) > CTLQUOTEMARK) && ((c) == '_' || isalpha((unsigned char) (c))))", - "#define is_in_name(c)\t((c) != PEOF && ((c) < CTLESC || (c) > CTLQUOTEMARK) && ((c) == '_' || isalnum((unsigned char) (c))))", + "#define is_eof(c)\t((c) == PEOF)", + "#define is_alpha(c)\t(((c) < CTLESC || (c) > CTLQUOTEMARK) && isalpha((unsigned char) (c)))", + "#define is_name(c)\t(((c) < CTLESC || (c) > CTLQUOTEMARK) && ((c) == '_' || isalpha((unsigned char) (c))))", + "#define is_in_name(c)\t(((c) < CTLESC || (c) > CTLQUOTEMARK) && ((c) == '_' || isalnum((unsigned char) (c))))", "#define is_special(c)\t((is_type+SYNBASE)[c] & (ISSPECL|ISDIGIT))", NULL }; |