diff options
author | Paul Smith <psmith@gnu.org> | 2012-03-04 08:58:44 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2012-03-04 08:58:44 +0000 |
commit | 76827d7c10c2708a3147171b02bfe3981492a38f (patch) | |
tree | 1e60aeb7b2ab1bc2573b9d436b539b0f6f52f160 /read.c | |
parent | eb632d7676e92fd5750413ab6a6d16f3a6fda5c4 (diff) | |
download | gunmake-76827d7c10c2708a3147171b02bfe3981492a38f.tar.gz |
Create a new CSTRLEN (constant string length) macro, and use it.
Diffstat (limited to 'read.c')
-rw-r--r-- | read.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -161,7 +161,7 @@ static char *find_char_unquote (char *string, int stop1, int stop2, /* Compare a word, both length and contents. P must point to the word to be tested, and WLEN must be the length. */ -#define word1eq(s) (wlen == sizeof(s)-1 && strneq (s, p, sizeof(s)-1)) +#define word1eq(s) (wlen == CSTRLEN (s) && strneq (s, p, CSTRLEN (s))) /* Read in all the makefiles and return the chain of their names. */ @@ -1282,7 +1282,7 @@ eval (struct ebuffer *ebuf, int set_default) record_waiting_files (); } -#undef word1eq +#undef word1eq if (conditionals->if_cmds) fatal (fstart, _("missing 'endif'")); @@ -1467,7 +1467,7 @@ conditional_line (char *line, int len, const struct floc *flocp) unsigned int o; /* Compare a word, both length and contents. */ -#define word1eq(s) (len == sizeof(s)-1 && strneq (s, line, sizeof(s)-1)) +#define word1eq(s) (len == CSTRLEN (s) && strneq (s, line, CSTRLEN (s))) #define chkword(s, t) if (word1eq (s)) { cmdtype = (t); cmdname = (s); } /* Make sure this line is a conditional. */ @@ -1542,7 +1542,7 @@ conditional_line (char *line, int len, const struct floc *flocp) len = p - line; /* If it's 'else' or 'endif' or an illegal conditional, fail. */ - if (word1eq("else") || word1eq("endif") + if (word1eq ("else") || word1eq ("endif") || conditional_line (line, len, flocp) < 0) EXTRANEOUS (); else |