diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2009-10-12 20:41:13 +0400 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2009-10-13 19:42:10 +0400 |
commit | f66ac7deb0c88cb93d0d654bc6e5435fb8020f89 (patch) | |
tree | 999dbb77059b9ba790f326b55134a94f5d456f94 | |
parent | bd416c6860cd48e9df78278923c43d3b03b761ad (diff) | |
download | nasm-f66ac7deb0c88cb93d0d654bc6e5435fb8020f89.tar.gz |
preproc.c: use string helpers
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r-- | preproc.c | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -473,18 +473,15 @@ static Token *delete_Token(Token * t); static char *check_tasm_directive(char *line) { int32_t i, j, k, m, len; - char *p = line, *oldline, oldchar; + char *p, *q, *oldline, oldchar; - /* Skip whitespace */ - while (nasm_isspace(*p) && *p != 0) - p++; + p = nasm_skip_spaces(line); /* Binary search for the directive name */ i = -1; j = elements(tasm_directives); - len = 0; - while (!nasm_isspace(p[len]) && p[len] != 0) - len++; + q = nasm_skip_word(p); + len = q - p; if (len) { oldchar = p[len]; p[len] = 0; @@ -999,9 +996,7 @@ static Token *tokenize(char *line) } } else if (nasm_isspace(*p)) { type = TOK_WHITESPACE; - p++; - while (*p && nasm_isspace(*p)) - p++; + p = nasm_skip_spaces(p); /* * Whitespace just before end-of-line is discarded by * pretending it's a comment; whitespace just before a |