=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/main.c,v retrieving revision 1.76 retrieving revision 1.77 diff -u -r1.76 -r1.77 --- src/usr.bin/mandoc/main.c 2011/04/24 16:22:02 1.76 +++ src/usr.bin/mandoc/main.c 2011/05/29 21:22:18 1.77 @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.76 2011/04/24 16:22:02 schwarze Exp $ */ +/* $Id: main.c,v 1.77 2011/05/29 21:22:18 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2011 Ingo Schwarze @@ -34,6 +34,8 @@ enum outt { OUTT_ASCII = 0, /* -Tascii */ + OUTT_LOCALE, /* -Tlocale */ + OUTT_UTF8, /* -Tutf8 */ OUTT_TREE, /* -Ttree */ OUTT_HTML, /* -Thtml */ OUTT_XHTML, /* -Txhtml */ @@ -197,10 +199,20 @@ 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; @@ -223,7 +235,6 @@ case (OUTT_XHTML): curp->outman = html_man; curp->outmdoc = html_mdoc; - curp->outfree = html_free; break; case (OUTT_TREE): curp->outman = tree_man; @@ -233,6 +244,10 @@ /* FALLTHROUGH */ case (OUTT_ASCII): /* FALLTHROUGH */ + case (OUTT_UTF8): + /* FALLTHROUGH */ + case (OUTT_LOCALE): + /* FALLTHROUGH */ case (OUTT_PS): curp->outman = terminal_man; curp->outmdoc = terminal_mdoc; @@ -290,6 +305,10 @@ curp->outtype = OUTT_TREE; else if (0 == strcmp(arg, "html")) curp->outtype = OUTT_HTML; + else if (0 == strcmp(arg, "utf8")) + curp->outtype = OUTT_UTF8; + 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"))