Print this page
5051 import mdocml-1.12.3
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Approved by: TBD

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mandoc/term_ascii.c
          +++ new/usr/src/cmd/mandoc/term_ascii.c
   1      -/*      $Id: term_ascii.c,v 1.20 2011/12/04 23:10:52 schwarze Exp $ */
        1 +/*      $Id: term_ascii.c,v 1.21 2013/06/01 14:27:20 schwarze Exp $ */
   2    2  /*
   3    3   * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
   4    4   *
   5    5   * Permission to use, copy, modify, and distribute this software for any
   6    6   * purpose with or without fee is hereby granted, provided that the above
   7    7   * copyright notice and this permission notice appear in all copies.
   8    8   *
   9    9   * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10   10   * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11   11   * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
↓ open down ↓ 54 lines elided ↑ open up ↑
  66   66  #endif
  67   67  
  68   68  static struct termp *
  69   69  ascii_init(enum termenc enc, char *outopts)
  70   70  {
  71   71          const char      *toks[4];
  72   72          char            *v;
  73   73          struct termp    *p;
  74   74  
  75   75          p = mandoc_calloc(1, sizeof(struct termp));
  76      -        p->enc = enc;
  77   76  
  78   77          p->tabwidth = 5;
  79   78          p->defrmargin = 78;
  80   79  
  81   80          p->begin = ascii_begin;
  82   81          p->end = ascii_end;
  83   82          p->hspan = ascii_hspan;
  84   83          p->type = TERMTYPE_CHAR;
  85   84  
  86   85          p->enc = TERMENC_ASCII;
  87   86          p->advance = ascii_advance;
  88   87          p->endline = ascii_endline;
  89   88          p->letter = ascii_letter;
  90   89          p->width = ascii_width;
  91   90  
  92   91  #ifdef  USE_WCHAR
  93   92          if (TERMENC_ASCII != enc) {
  94   93                  v = TERMENC_LOCALE == enc ?
  95   94                          setlocale(LC_ALL, "") :
  96      -                        setlocale(LC_CTYPE, "UTF-8");
       95 +                        setlocale(LC_CTYPE, "en_US.UTF-8");
  97   96                  if (NULL != v && MB_CUR_MAX > 1) {
  98   97                          p->enc = enc;
  99   98                          p->advance = locale_advance;
 100   99                          p->endline = locale_endline;
 101  100                          p->letter = locale_letter;
 102  101                          p->width = locale_width;
 103  102                  }
 104  103          }
 105  104  #endif
 106  105  
↓ open down ↓ 183 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX