version 1.252, 2015/01/21 02:16:52 |
version 1.254, 2015/01/23 00:42:00 |
Line 1004 roff_res(struct roff *r, struct buf *buf, int ln, int |
|
Line 1004 roff_res(struct roff *r, struct buf *buf, int ln, int |
|
|
|
/* Advance to the end of the name. */ |
/* Advance to the end of the name. */ |
|
|
|
naml = 0; |
arg_complete = 1; |
arg_complete = 1; |
for (naml = 0; maxl == 0 || naml < maxl; naml++, cp++) { |
while (maxl == 0 || naml < maxl) { |
if (*cp == '\0') { |
if (*cp == '\0') { |
mandoc_msg(MANDOCERR_ESC_BAD, r->parse, |
mandoc_msg(MANDOCERR_ESC_BAD, r->parse, |
ln, (int)(stesc - buf->buf), stesc); |
ln, (int)(stesc - buf->buf), stesc); |
Line 1016 roff_res(struct roff *r, struct buf *buf, int ln, int |
|
Line 1017 roff_res(struct roff *r, struct buf *buf, int ln, int |
|
cp++; |
cp++; |
break; |
break; |
} |
} |
|
if (*cp++ != '\\' || stesc[1] != 'w') { |
|
naml++; |
|
continue; |
|
} |
|
switch (mandoc_escape(&cp, NULL, NULL)) { |
|
case ESCAPE_SPECIAL: |
|
/* FALLTHROUGH */ |
|
case ESCAPE_UNICODE: |
|
/* FALLTHROUGH */ |
|
case ESCAPE_NUMBERED: |
|
/* FALLTHROUGH */ |
|
case ESCAPE_OVERSTRIKE: |
|
naml++; |
|
break; |
|
default: |
|
break; |
|
} |
} |
} |
|
|
/* |
/* |
Line 1623 roff_getnum(const char *v, int *pos, int *res) |
|
Line 1641 roff_getnum(const char *v, int *pos, int *res) |
|
if (n) |
if (n) |
*res = -*res; |
*res = -*res; |
|
|
*pos = p; |
/* Each number may be followed by one optional scaling unit. */ |
return 1; |
|
|
switch (v[p]) { |
|
case 'f': |
|
*res *= 65536; |
|
break; |
|
case 'i': |
|
*res *= 240; |
|
break; |
|
case 'c': |
|
*res *= 240; |
|
*res /= 2.54; |
|
break; |
|
case 'v': |
|
/* FALLTROUGH */ |
|
case 'P': |
|
*res *= 40; |
|
break; |
|
case 'm': |
|
/* FALLTROUGH */ |
|
case 'n': |
|
*res *= 24; |
|
break; |
|
case 'p': |
|
*res *= 10; |
|
*res /= 3; |
|
break; |
|
case 'u': |
|
break; |
|
case 'M': |
|
*res *= 6; |
|
*res /= 25; |
|
break; |
|
default: |
|
p--; |
|
break; |
|
} |
|
|
|
*pos = p + 1; |
|
return(1); |
} |
} |
|
|
/* |
/* |