version 1.247, 2015/01/01 19:28:49 |
version 1.249, 2015/01/14 22:58:16 |
Line 2103 roff_tr(ROFF_ARGS) |
|
Line 2103 roff_tr(ROFF_ARGS) |
|
static enum rofferr |
static enum rofferr |
roff_so(ROFF_ARGS) |
roff_so(ROFF_ARGS) |
{ |
{ |
char *name; |
char *name, *cp; |
|
|
name = buf->buf + pos; |
name = buf->buf + pos; |
mandoc_vmsg(MANDOCERR_SO, r->parse, ln, ppos, "so %s", name); |
mandoc_vmsg(MANDOCERR_SO, r->parse, ln, ppos, "so %s", name); |
Line 2118 roff_so(ROFF_ARGS) |
|
Line 2118 roff_so(ROFF_ARGS) |
|
if (*name == '/' || strstr(name, "../") || strstr(name, "/..")) { |
if (*name == '/' || strstr(name, "../") || strstr(name, "/..")) { |
mandoc_vmsg(MANDOCERR_SO_PATH, r->parse, ln, ppos, |
mandoc_vmsg(MANDOCERR_SO_PATH, r->parse, ln, ppos, |
".so %s", name); |
".so %s", name); |
return(ROFF_ERR); |
buf->sz = mandoc_asprintf(&cp, |
|
".sp\nSee the file %s.\n.sp", name) + 1; |
|
free(buf->buf); |
|
buf->buf = cp; |
|
*offs = 0; |
|
return(ROFF_REPARSE); |
} |
} |
|
|
*offs = pos; |
*offs = pos; |
Line 2169 roff_userdef(ROFF_ARGS) |
|
Line 2174 roff_userdef(ROFF_ARGS) |
|
buf->buf = n1; |
buf->buf = n1; |
if (buf->sz == 0) |
if (buf->sz == 0) |
buf->sz = strlen(buf->buf) + 1; |
buf->sz = strlen(buf->buf) + 1; |
|
*offs = 0; |
|
|
return(buf->sz > 1 && buf->buf[buf->sz - 2] == '\n' ? |
return(buf->sz > 1 && buf->buf[buf->sz - 2] == '\n' ? |
ROFF_REPARSE : ROFF_APPEND); |
ROFF_REPARSE : ROFF_APPEND); |