summaryrefslogtreecommitdiffstats
path: root/argv.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-02-24 13:46:54 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-02-24 13:46:54 +0000
commit38fefdf005d8237391f4aabfb145c4a96d930b8b (patch)
tree3140d1ac71c9d4d0d8ed643bc9937302d4cf9379 /argv.c
parentc8bf126a0b893c247fa4ec7b271fa51308fe257f (diff)
downloadmandoc-38fefdf005d8237391f4aabfb145c4a96d930b8b.tar.gz
Character-encoding checked for all text (arguments/values).
Diffstat (limited to 'argv.c')
-rw-r--r--argv.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/argv.c b/argv.c
index 51ef35b2..b72c5696 100644
--- a/argv.c
+++ b/argv.c
@@ -267,7 +267,7 @@ static int
args(struct mdoc *mdoc, int line,
int *pos, char *buf, int fl, char **v)
{
- int i, c;
+ int i;
char *p, *pp;
assert(*pos > 0);
@@ -290,14 +290,11 @@ args(struct mdoc *mdoc, int line,
*/
if ((fl & ARGS_DELIM) && mdoc_iscdelim(buf[*pos])) {
- for (i = *pos; (c = buf[i]); ) {
- if ( ! mdoc_iscdelim(c))
+ for (i = *pos; buf[i]; ) {
+ if ( ! mdoc_iscdelim(buf[i]))
break;
i++;
- if (0 == buf[i] || ! isspace(c))
- break;
- i++;
- while (buf[i] && isspace(c))
+ while (buf[i] && isspace((int)buf[i]))
i++;
}
if (0 == buf[i]) {
@@ -404,8 +401,8 @@ args(struct mdoc *mdoc, int line,
/* Do non-tabsep look-ahead here. */
if ( ! (ARGS_TABSEP & fl))
- while ((c = buf[*pos])) {
- if (isspace(c))
+ while (buf[*pos]) {
+ if (isspace((int)buf[*pos]))
if ('\\' != buf[*pos - 1])
break;
(*pos)++;