X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/e1bb09be17d41880b391cdcbe9d968f8964928ff..ab189900401da15dee3e20b86bd32d1cdb7e37ac:/roff.c?ds=sidebyside diff --git a/roff.c b/roff.c index 07480a12..30e92309 100644 --- a/roff.c +++ b/roff.c @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.209 2014/04/23 16:08:33 schwarze Exp $ */ +/* $Id: roff.c,v 1.211 2014/06/29 21:20:31 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -1938,7 +1938,8 @@ roff_so(ROFF_ARGS) { char *name; - mandoc_msg(MANDOCERR_SO, r->parse, ln, ppos, NULL); + name = *bufp + pos; + mandoc_vmsg(MANDOCERR_SO, r->parse, ln, ppos, ".so %s", name); /* * Handle `so'. Be EXTREMELY careful, as we shouldn't be @@ -1947,9 +1948,9 @@ roff_so(ROFF_ARGS) * or using absolute paths. */ - name = *bufp + pos; if ('/' == *name || strstr(name, "../") || strstr(name, "/..")) { - mandoc_msg(MANDOCERR_SOPATH, r->parse, ln, pos, NULL); + mandoc_vmsg(MANDOCERR_SO_PATH, r->parse, ln, ppos, + ".so %s", name); return(ROFF_ERR); } @@ -2067,7 +2068,8 @@ roff_setstrn(struct roffkv **r, const char *name, size_t namesz, /* Search for an existing string with the same name. */ n = *r; - while (n && strcmp(name, n->key.p)) + while (n && (namesz != n->key.sz || + strncmp(n->key.p, name, namesz))) n = n->next; if (NULL == n) {