summaryrefslogtreecommitdiff
path: root/nasm.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2009-10-13 19:38:52 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2009-10-13 19:42:14 +0400
commitd61debfc913192260a256e894251ef9a24da8493 (patch)
treebaa6b1846521bcb88da9ef2daced3f6de9f069f9 /nasm.c
parentf66ac7deb0c88cb93d0d654bc6e5435fb8020f89 (diff)
downloadnasm-d61debfc913192260a256e894251ef9a24da8493.tar.gz
nasm.c: use string helpers
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'nasm.c')
-rw-r--r--nasm.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/nasm.c b/nasm.c
index 20049654..ed0a2cb7 100644
--- a/nasm.c
+++ b/nasm.c
@@ -497,12 +497,8 @@ int main(int argc, char **argv)
static char *get_param(char *p, char *q, bool *advance)
{
*advance = false;
- if (p[2]) { /* the parameter's in the option */
- p += 2;
- while (nasm_isspace(*p))
- p++;
- return p;
- }
+ if (p[2]) /* the parameter's in the option */
+ return nasm_skip_spaces(p + 2);
if (q && q[0]) {
*advance = true;
return q;
@@ -1023,9 +1019,7 @@ static void process_respfile(FILE * rfile)
while (p > buffer && nasm_isspace(p[-1]))
*--p = '\0';
- p = buffer;
- while (nasm_isspace(*p))
- p++;
+ p = nasm_skip_spaces(buffer);
if (process_arg(prevarg, p))
*p = '\0';
@@ -1337,8 +1331,7 @@ static void assemble_file(char *fname, StrList **depend_ptr)
break;
}
if (*p) {
- while (*p && nasm_isspace(*p))
- *p++ = '\0';
+ p = nasm_zap_spaces(p);
q = p;
while (*q && *q != ':')
q++;
@@ -1426,16 +1419,13 @@ static void assemble_file(char *fname, StrList **depend_ptr)
"DEBUG identifier too long");
break;
}
- while (*p && nasm_isspace(*p))
- p++;
+ p = nasm_skip_spaces(p);
if (pass0 == 2)
dfmt->debug_directive(debugid, p);
break;
}
case D_WARNING: /* [WARNING {+|-|*}warn-name] */
- while (*value && nasm_isspace(*value))
- value++;
-
+ value = nasm_skip_spaces(value);
switch(*value) {
case '-': validid = 0; value++; break;
case '+': validid = 1; value++; break;
@@ -1467,9 +1457,7 @@ static void assemble_file(char *fname, StrList **depend_ptr)
cpu = get_cpu(value);
break;
case D_LIST: /* [LIST {+|-}] */
- while (*value && nasm_isspace(*value))
- value++;
-
+ value = nasm_skip_spaces(value);
if (*value == '+') {
user_nolist = 0;
} else {