]> git.cameronkatri.com Git - mandoc.git/blobdiff - term.c
Use a character-table for quick per-character substitution in `tr'. As
[mandoc.git] / term.c
diff --git a/term.c b/term.c
index 2bcdb69dfffe9d84bf840c7788ba15c99d321d97..70260bec31a613857102aa7dbd1603ac2a118d3c 100644 (file)
--- a/term.c
+++ b/term.c
@@ -1,4 +1,4 @@
-/*     $Id: term.c,v 1.196 2011/05/20 15:44:55 kristaps Exp $ */
+/*     $Id: term.c,v 1.197 2011/05/24 21:31:23 kristaps Exp $ */
 /*
  * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -447,12 +447,6 @@ term_word(struct termp *p, const char *word)
                                        break;
                                encode1(p, uc);
                                continue;
-                       case (ESCAPE_PREDEF):
-                               uc = mchars_res2cp(p->symtab, seq, sz);
-                               if (uc <= 0)
-                                       break;
-                               encode1(p, uc);
-                               continue;
                        case (ESCAPE_SPECIAL):
                                uc = mchars_spec2cp(p->symtab, seq, sz);
                                if (uc <= 0)
@@ -472,11 +466,6 @@ term_word(struct termp *p, const char *word)
                        if ('\0' != c)
                                encode(p, &c, 1);
                        break;
-               case (ESCAPE_PREDEF):
-                       cp = mchars_res2str(p->symtab, seq, sz, &ssz);
-                       if (NULL != cp)
-                               encode(p, cp, ssz);
-                       break;
                case (ESCAPE_SPECIAL):
                        cp = mchars_spec2str(p->symtab, seq, sz, &ssz);
                        if (NULL != cp) 
@@ -648,13 +637,6 @@ term_strlen(const struct termp *p, const char *cp)
                                                break;
                                        sz += (*p->width)(p, c);
                                        continue;
-                               case (ESCAPE_PREDEF):
-                                       c = mchars_res2cp
-                                               (p->symtab, seq, ssz);
-                                       if (c <= 0)
-                                               break;
-                                       sz += (*p->width)(p, c);
-                                       continue;
                                case (ESCAPE_SPECIAL):
                                        c = mchars_spec2cp
                                                (p->symtab, seq, ssz);
@@ -677,10 +659,6 @@ term_strlen(const struct termp *p, const char *cp)
                                if ('\0' != c)
                                        sz += (*p->width)(p, c);
                                break;
-                       case (ESCAPE_PREDEF):
-                               rhs = mchars_res2str
-                                       (p->symtab, seq, ssz, &rsz);
-                               break;
                        case (ESCAPE_SPECIAL):
                                rhs = mchars_spec2str
                                        (p->symtab, seq, ssz, &rsz);