summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2009-10-12 20:41:13 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2009-10-13 19:42:10 +0400
commitf66ac7deb0c88cb93d0d654bc6e5435fb8020f89 (patch)
tree999dbb77059b9ba790f326b55134a94f5d456f94
parentbd416c6860cd48e9df78278923c43d3b03b761ad (diff)
downloadnasm-f66ac7deb0c88cb93d0d654bc6e5435fb8020f89.tar.gz
preproc.c: use string helpers
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--preproc.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/preproc.c b/preproc.c
index feccc33a..dab0b2af 100644
--- a/preproc.c
+++ b/preproc.c
@@ -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