[BACK]Return to chars.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/chars.c between version 1.48 and 1.51

version 1.48, 2011/07/21 15:21:13 version 1.51, 2011/09/18 14:14:15
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
Line 37  struct ln {
Line 37  struct ln {
         int               unicode;          int               unicode;
 };  };
   
 #define LINES_MAX         325  #define LINES_MAX         328
   
 #define CHAR(in, ch, code) \  #define CHAR(in, ch, code) \
         { NULL, (in), (ch), (code) },          { NULL, (in), (ch), (code) },
Line 113  mchars_num2char(const char *p, size_t sz)
Line 113  mchars_num2char(const char *p, size_t sz)
   
         if ((i = mandoc_strntoi(p, sz, 10)) < 0)          if ((i = mandoc_strntoi(p, sz, 10)) < 0)
                 return('\0');                  return('\0');
         return(isprint(i) ? i : '\0');          return(i > 0 && i < 256 && isprint(i) ? i : '\0');
 }  }
   
 int  int
Line 133  mchars_spec2str(struct mchars *arg, const char *p, siz
Line 133  mchars_spec2str(struct mchars *arg, const char *p, siz
         const struct ln *ln;          const struct ln *ln;
   
         ln = find(arg, p, sz);          ln = find(arg, p, sz);
         if (NULL == ln)          if (NULL == ln) {
                   *rsz = 1;
                 return(NULL);                  return(NULL);
           }
   
         *rsz = strlen(ln->ascii);          *rsz = strlen(ln->ascii);
         return(ln->ascii);          return(ln->ascii);

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.51

CVSweb