diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2002-06-11 21:12:12 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2002-06-11 21:12:12 +0000 |
commit | b1c15445b12ccbda5a402ec56b487665b69747ee (patch) | |
tree | 39735876bf91b2f6bf39bfb577853773ffc0f705 /usr.bin/make/for.c | |
parent | e7478c049fc780b84e5d9267b380f93757391a22 (diff) |
This is the first step in sanitizing the conditional parser.
Change the conditional recognition algorithm:
scan for a sequence of alphabetic characters, hash it, and compare it against
a small table (using ohash functions).
This makes Cond_Eval entry more logical, and allows for some shortcuts in
recognizing .include, .for, .undef.
This also means that conditionals must have an intervening blank between
the keyword and the actual test, e.g.,
.ifA
will no longer work.
(but no-one actually uses this, and it's highly obfuscated)
Okay miod@.
Diffstat (limited to 'usr.bin/make/for.c')
-rw-r--r-- | usr.bin/make/for.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/usr.bin/make/for.c b/usr.bin/make/for.c index c71378497d2..fa97c94c7e4 100644 --- a/usr.bin/make/for.c +++ b/usr.bin/make/for.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: for.c,v 1.26 2001/05/29 12:53:40 espie Exp $ */ +/* $OpenBSD: for.c,v 1.27 2002/06/11 21:12:11 espie Exp $ */ /* $NetBSD: for.c,v 1.4 1996/11/06 17:59:05 christos Exp $ */ /* @@ -146,13 +146,6 @@ For_Eval(line) For *arg; unsigned long n; - /* If we are not in a for loop quickly determine if the statement is - * a for. */ - if (ptr[0] != 'f' || ptr[1] != 'o' || ptr[2] != 'r' || - !isspace(ptr[3])) - return NULL; - ptr += 4; - while (*ptr && isspace(*ptr)) ptr++; |