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

Diff for /mandoc/mandoc.c between version 1.87 and 1.93

version 1.87, 2014/10/13 17:17:45 version 1.93, 2015/08/29 22:40:05
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2011-2015 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
  * purpose with or without fee is hereby granted, provided that the above   * purpose with or without fee is hereby granted, provided that the above
Line 95  mandoc_escape(const char **end, const char **start, in
Line 95  mandoc_escape(const char **end, const char **start, in
         case 'd':          case 'd':
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case 'u':          case 'u':
                   /* FALLTHROUGH */
           case ',':
                   /* FALLTHROUGH */
           case '/':
                 return(ESCAPE_IGNORE);                  return(ESCAPE_IGNORE);
   
         /*          /*
Line 156  mandoc_escape(const char **end, const char **start, in
Line 160  mandoc_escape(const char **end, const char **start, in
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case 'D':          case 'D':
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case 'o':  
                 /* FALLTHROUGH */  
         case 'R':          case 'R':
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case 'X':          case 'X':
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case 'Z':          case 'Z':
                 if ('\0' == **start)  
                         return(ESCAPE_ERROR);  
                 gly = ESCAPE_IGNORE;                  gly = ESCAPE_IGNORE;
                   /* FALLTHROUGH */
           case 'o':
                   if (**start == '\0')
                           return(ESCAPE_ERROR);
                   if (gly == ESCAPE_ERROR)
                           gly = ESCAPE_OVERSTRIKE;
                 term = **start;                  term = **start;
                 *start = ++*end;                  *start = ++*end;
                 break;                  break;
Line 225  mandoc_escape(const char **end, const char **start, in
Line 231  mandoc_escape(const char **end, const char **start, in
   
                 /* See +/- counts as a sign. */                  /* See +/- counts as a sign. */
                 if ('+' == **end || '-' == **end || ASCII_HYPH == **end)                  if ('+' == **end || '-' == **end || ASCII_HYPH == **end)
                         (*end)++;                          *start = ++*end;
   
                 switch (**end) {                  switch (**end) {
                 case '(':                  case '(':
Line 240  mandoc_escape(const char **end, const char **start, in
Line 246  mandoc_escape(const char **end, const char **start, in
                         *start = ++*end;                          *start = ++*end;
                         term = '\'';                          term = '\'';
                         break;                          break;
                   case '3':
                           /* FALLTHROUGH */
                   case '2':
                           /* FALLTHROUGH */
                   case '1':
                           *sz = (*end)[-1] == 's' &&
                               isdigit((unsigned char)(*end)[1]) ? 2 : 1;
                           break;
                 default:                  default:
                         *sz = 1;                          *sz = 1;
                         break;                          break;
Line 334  mandoc_escape(const char **end, const char **start, in
Line 348  mandoc_escape(const char **end, const char **start, in
                 if (1 == *sz && 'c' == **start)                  if (1 == *sz && 'c' == **start)
                         gly = ESCAPE_NOSPACE;                          gly = ESCAPE_NOSPACE;
                 /*                  /*
                  * Unicode escapes are defined in groff as \[uXXXX]                   * Unicode escapes are defined in groff as \[u0000]
                  * to \[u10FFFF], where the contained value must be                   * to \[u10FFFF], where the contained value must be
                  * a valid Unicode codepoint.  Here, however, only                   * a valid Unicode codepoint.  Here, however, only
                  * check the length and the validity of all digits.                   * check the length and range.
                  */                   */
                 else if (*sz > 4 && *sz < 8 && **start == 'u' &&                  if (**start != 'u' || *sz < 5 || *sz > 7)
                     (int)strspn(*start + 1, "0123456789ABCDEFabcdef")                          break;
                   if (*sz == 7 && ((*start)[1] != '1' || (*start)[2] != '0'))
                           break;
                   if (*sz == 6 && (*start)[1] == '0')
                           break;
                   if ((int)strspn(*start + 1, "0123456789ABCDEFabcdef")
                     + 1 == *sz)                      + 1 == *sz)
                         gly = ESCAPE_UNICODE;                          gly = ESCAPE_UNICODE;
                 break;                  break;
Line 475  time2a(time_t t)
Line 494  time2a(time_t t)
         int              isz;          int              isz;
   
         tm = localtime(&t);          tm = localtime(&t);
           if (tm == NULL)
                   return(NULL);
   
         /*          /*
          * Reserve space:           * Reserve space:

Legend:
Removed from v.1.87  
changed lines
  Added in v.1.93

CVSweb