version 1.288, 2017/01/12 18:02:20 |
version 1.289, 2017/02/17 03:03:03 |
Line 1226 deroff(char **dest, const struct roff_node *n) |
|
Line 1226 deroff(char **dest, const struct roff_node *n) |
|
/* Skip leading whitespace. */ |
/* Skip leading whitespace. */ |
|
|
for (cp = n->string; *cp != '\0'; cp++) { |
for (cp = n->string; *cp != '\0'; cp++) { |
if (cp[0] == '\\' && strchr(" %&0^|~", cp[1]) != NULL) |
if (cp[0] == '\\' && cp[1] != '\0' && |
|
strchr(" %&0^|~", cp[1]) != NULL) |
cp++; |
cp++; |
else if ( ! isspace((unsigned char)*cp)) |
else if ( ! isspace((unsigned char)*cp)) |
break; |
break; |
} |
} |
|
|
|
/* Skip trailing backslash. */ |
|
|
|
sz = strlen(cp); |
|
if (cp[sz - 1] == '\\') |
|
sz--; |
|
|
/* Skip trailing whitespace. */ |
/* Skip trailing whitespace. */ |
|
|
for (sz = strlen(cp); sz; sz--) |
for (; sz; sz--) |
if ( ! isspace((unsigned char)cp[sz-1])) |
if ( ! isspace((unsigned char)cp[sz-1])) |
break; |
break; |
|
|
Line 3358 roff_strdup(const struct roff *r, const char *p) |
|
Line 3365 roff_strdup(const struct roff *r, const char *p) |
|
ssz = 0; |
ssz = 0; |
|
|
while ('\0' != *p) { |
while ('\0' != *p) { |
if ('\\' != *p && r->xtab && r->xtab[(int)*p].p) { |
assert((unsigned int)*p < 128); |
|
if ('\\' != *p && r->xtab && r->xtab[(unsigned int)*p].p) { |
sz = r->xtab[(int)*p].sz; |
sz = r->xtab[(int)*p].sz; |
res = mandoc_realloc(res, ssz + sz + 1); |
res = mandoc_realloc(res, ssz + sz + 1); |
memcpy(res + ssz, r->xtab[(int)*p].p, sz); |
memcpy(res + ssz, r->xtab[(int)*p].p, sz); |