=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/main.c,v retrieving revision 1.101 retrieving revision 1.102 diff -c -r1.101 -r1.102 *** src/usr.bin/mandoc/main.c 2014/10/18 15:46:16 1.101 --- src/usr.bin/mandoc/main.c 2014/10/28 17:35:42 1.102 *************** *** 1,4 **** ! /* $OpenBSD: main.c,v 1.101 2014/10/18 15:46:16 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010, 2011, 2012, 2014 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: main.c,v 1.102 2014/10/28 17:35:42 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010, 2011, 2012, 2014 Ingo Schwarze *************** *** 57,63 **** OUTT_TREE, /* -Ttree */ OUTT_MAN, /* -Tman */ OUTT_HTML, /* -Thtml */ - OUTT_XHTML, /* -Txhtml */ OUTT_LINT, /* -Tlint */ OUTT_PS, /* -Tps */ OUTT_PDF /* -Tpdf */ --- 57,62 ---- *************** *** 65,70 **** --- 64,70 ---- struct curparse { struct mparse *mp; + struct mchars *mchars; /* character table */ enum mandoclevel wlevel; /* ignore messages below this */ int wstop; /* stop after a file with a warning */ enum outt outtype; /* which output to use */ *************** *** 346,352 **** if (use_pager && isatty(STDOUT_FILENO)) spawn_pager(); ! curp.mp = mparse_alloc(options, curp.wlevel, mmsg, defos); /* * Conditionally start up the lookaside buffer before parsing. --- 346,354 ---- if (use_pager && isatty(STDOUT_FILENO)) spawn_pager(); ! curp.mchars = mchars_alloc(); ! curp.mp = mparse_alloc(options, curp.wlevel, mmsg, ! curp.mchars, defos); /* * Conditionally start up the lookaside buffer before parsing. *************** *** 388,395 **** if (curp.outfree) (*curp.outfree)(curp.outdata); ! if (curp.mp) ! mparse_free(curp.mp); out: if (search.argmode != ARG_FILE) { --- 390,397 ---- if (curp.outfree) (*curp.outfree)(curp.outdata); ! mparse_free(curp.mp); ! mchars_free(curp.mchars); out: if (search.argmode != ARG_FILE) { *************** *** 472,503 **** if ( ! (curp->outman && curp->outmdoc)) { switch (curp->outtype) { - case OUTT_XHTML: - curp->outdata = xhtml_alloc(curp->outopts); - curp->outfree = html_free; - break; case OUTT_HTML: ! curp->outdata = html_alloc(curp->outopts); curp->outfree = html_free; break; case OUTT_UTF8: ! curp->outdata = utf8_alloc(curp->outopts); curp->outfree = ascii_free; break; case OUTT_LOCALE: ! curp->outdata = locale_alloc(curp->outopts); curp->outfree = ascii_free; break; case OUTT_ASCII: ! curp->outdata = ascii_alloc(curp->outopts); curp->outfree = ascii_free; break; case OUTT_PDF: ! curp->outdata = pdf_alloc(curp->outopts); curp->outfree = pspdf_free; break; case OUTT_PS: ! curp->outdata = ps_alloc(curp->outopts); curp->outfree = pspdf_free; break; default: --- 474,507 ---- if ( ! (curp->outman && curp->outmdoc)) { switch (curp->outtype) { case OUTT_HTML: ! curp->outdata = html_alloc(curp->mchars, ! curp->outopts); curp->outfree = html_free; break; case OUTT_UTF8: ! curp->outdata = utf8_alloc(curp->mchars, ! curp->outopts); curp->outfree = ascii_free; break; case OUTT_LOCALE: ! curp->outdata = locale_alloc(curp->mchars, ! curp->outopts); curp->outfree = ascii_free; break; case OUTT_ASCII: ! curp->outdata = ascii_alloc(curp->mchars, ! curp->outopts); curp->outfree = ascii_free; break; case OUTT_PDF: ! curp->outdata = pdf_alloc(curp->mchars, ! curp->outopts); curp->outfree = pspdf_free; break; case OUTT_PS: ! curp->outdata = ps_alloc(curp->mchars, ! curp->outopts); curp->outfree = pspdf_free; break; default: *************** *** 506,513 **** switch (curp->outtype) { case OUTT_HTML: - /* FALLTHROUGH */ - case OUTT_XHTML: curp->outman = html_man; curp->outmdoc = html_mdoc; break; --- 510,515 ---- *************** *** 622,628 **** else if (0 == strcmp(arg, "locale")) curp->outtype = OUTT_LOCALE; else if (0 == strcmp(arg, "xhtml")) ! curp->outtype = OUTT_XHTML; else if (0 == strcmp(arg, "ps")) curp->outtype = OUTT_PS; else if (0 == strcmp(arg, "pdf")) --- 624,630 ---- else if (0 == strcmp(arg, "locale")) curp->outtype = OUTT_LOCALE; else if (0 == strcmp(arg, "xhtml")) ! curp->outtype = OUTT_HTML; else if (0 == strcmp(arg, "ps")) curp->outtype = OUTT_PS; else if (0 == strcmp(arg, "pdf"))