X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/halibut/blobdiff_plain/b0ea3acdfdfdc5f927b16a4a3b050058c335b7c8..416dfe1719254d4718888fdbb0b0ac6d3ad91705:/bk_man.c diff --git a/bk_man.c b/bk_man.c index 3b92aeb..d2607d9 100644 --- a/bk_man.c +++ b/bk_man.c @@ -42,7 +42,7 @@ static manconfig man_configure(paragraph *source) { /* * Two-pass configuration so that we can pick up global config * (e.g. `quotes') before having it overridden by specific - * config (`text-quotes'), irrespective of the order in which + * config (`man-quotes'), irrespective of the order in which * they occur. */ for (p = source; p; p = p->next) { @@ -66,12 +66,10 @@ static manconfig man_configure(paragraph *source) { while (*ep) ep = uadv(ep); sfree(ret.th); - ret.th = mknewa(wchar_t, ep - wp + 1); + ret.th = snewn(ep - wp + 1, wchar_t); memcpy(ret.th, wp, (ep - wp + 1) * sizeof(wchar_t)); } else if (!ustricmp(p->keyword, L"man-charset")) { - char *csname = utoa_dup(uadv(p->keyword), CS_ASCII); - ret.charset = charset_from_localenc(csname); - sfree(csname); + ret.charset = charset_from_ustr(&p->fpos, uadv(p->keyword)); } else if (!ustricmp(p->keyword, L"man-headnumbers")) { ret.headnumbers = utob(uadv(p->keyword)); } else if (!ustricmp(p->keyword, L"man-mindepth")) { @@ -81,7 +79,7 @@ static manconfig man_configure(paragraph *source) { ret.filename = dupstr(adv(p->origkeyword)); } else if (!ustricmp(p->keyword, L"man-bullet")) { ret.bullet = uadv(p->keyword); - } else if (!ustricmp(p->keyword, L"text-quotes")) { + } else if (!ustricmp(p->keyword, L"man-quotes")) { if (*uadv(p->keyword) && *uadv(uadv(p->keyword))) { ret.lquote = uadv(p->keyword); ret.rquote = uadv(ret.lquote); @@ -321,7 +319,7 @@ static int man_convert(wchar_t const *s, int maxlen, psize = 384; plen = 0; - p = mknewa(char, psize); + p = snewn(psize, char); err = 0; while (slen > 0) { @@ -331,7 +329,7 @@ static int man_convert(wchar_t const *s, int maxlen, plen += ret; if (psize - plen < 256) { psize = plen + 256; - p = resize(p, psize); + p = sresize(p, psize, char); } } }