=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/term.c,v retrieving revision 1.14 retrieving revision 1.15 diff -c -r1.14 -r1.15 *** src/usr.bin/mandoc/term.c 2009/10/18 21:03:31 1.14 --- src/usr.bin/mandoc/term.c 2009/10/19 09:16:58 1.15 *************** *** 1,4 **** ! /* $Id: term.c,v 1.14 2009/10/18 21:03:31 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * --- 1,4 ---- ! /* $Id: term.c,v 1.15 2009/10/19 09:16:58 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * *************** *** 20,25 **** --- 20,26 ---- #include #include + #include "chars.h" #include "term.h" #include "man.h" #include "mdoc.h" *************** *** 56,62 **** p = (struct termp *)arg; if (NULL == p->symtab) ! p->symtab = term_ascii2htab(); man_run(p, man); } --- 57,63 ---- p = (struct termp *)arg; if (NULL == p->symtab) ! p->symtab = chars_init(CHARS_ASCII); man_run(p, man); } *************** *** 69,75 **** p = (struct termp *)arg; if (NULL == p->symtab) ! p->symtab = term_ascii2htab(); mdoc_run(p, mdoc); } --- 70,76 ---- p = (struct termp *)arg; if (NULL == p->symtab) ! p->symtab = chars_init(CHARS_ASCII); mdoc_run(p, mdoc); } *************** *** 89,96 **** if (p->buf) free(p->buf); ! if (TERMENC_ASCII == p->enc && p->symtab) ! term_asciifree(p->symtab); free(p); } --- 90,97 ---- if (p->buf) free(p->buf); ! if (p->symtab) ! chars_free(p->symtab); free(p); } *************** *** 102,108 **** struct termp *p; if (NULL == (p = malloc(sizeof(struct termp)))) ! err(1, "malloc"); bzero(p, sizeof(struct termp)); p->maxrmargin = 78; p->enc = enc; --- 103,109 ---- struct termp *p; if (NULL == (p = malloc(sizeof(struct termp)))) ! return(NULL); bzero(p, sizeof(struct termp)); p->maxrmargin = 78; p->enc = enc; *************** *** 331,337 **** size_t sz; int i; ! rhs = term_a2ascii(p->symtab, word, len, &sz); if (NULL == rhs) { #if 0 --- 332,338 ---- size_t sz; int i; ! rhs = chars_a2ascii(p->symtab, word, len, &sz); if (NULL == rhs) { #if 0 *************** *** 354,360 **** size_t sz; int i; ! rhs = term_a2res(p->symtab, word, len, &sz); if (NULL == rhs) { #if 0 --- 355,361 ---- size_t sz; int i; ! rhs = chars_a2res(p->symtab, word, len, &sz); if (NULL == rhs) { #if 0 *************** *** 555,561 **** s = p->maxcols * 2; p->buf = realloc(p->buf, s); if (NULL == p->buf) ! err(1, "realloc"); p->maxcols = s; } p->buf[(int)(p->col)++] = c; --- 556,562 ---- s = p->maxcols * 2; p->buf = realloc(p->buf, s); if (NULL == p->buf) ! err(1, "realloc"); /* FIXME: shouldn't be here! */ p->maxcols = s; } p->buf[(int)(p->col)++] = c;