summaryrefslogtreecommitdiffstats
path: root/mdoc_argv.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-04-17 09:13:01 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-04-17 09:13:01 +0000
commit0032b14580c9541acf18a121f4fbb37f17ac57ea (patch)
treebd19a91ea6eb0f865f5b1e52b2f7a02bcc8d931f /mdoc_argv.c
parent3a57b035c09a784e5ce7ada2b1a4ce22ed7320fe (diff)
downloadmandoc-0032b14580c9541acf18a121f4fbb37f17ac57ea.tar.gz
Use mandoc_getarg() for the regular case of processing unquoted
arguments in -mdoc documents.
Diffstat (limited to 'mdoc_argv.c')
-rw-r--r--mdoc_argv.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/mdoc_argv.c b/mdoc_argv.c
index 32bdc0cf..3c1484ef 100644
--- a/mdoc_argv.c
+++ b/mdoc_argv.c
@@ -568,25 +568,9 @@ args(struct mdoc *m, int line, int *pos,
return(ARGS_QWORD);
}
- /*
- * A non-quoted term progresses until either the end of line or
- * a non-escaped whitespace.
- */
-
- for ( ; buf[*pos]; (*pos)++)
- if (*pos && ' ' == buf[*pos] && '\\' != buf[*pos - 1])
- break;
-
- if ('\0' == buf[*pos])
- return(ARGS_WORD);
-
- buf[(*pos)++] = '\0';
-
- while (' ' == buf[*pos])
- (*pos)++;
-
- if ('\0' == buf[*pos] && ! (ARGS_NOWARN & fl))
- mdoc_pmsg(m, line, *pos, MANDOCERR_EOLNSPACE);
+ p = &buf[*pos];
+ *v = mandoc_getarg(m->parse, &p, line,
+ ! (ARGS_NOWARN & fl), pos);
return(ARGS_WORD);
}