/[pcre]/code/trunk/pcretest.c
ViewVC logotype

Diff of /code/trunk/pcretest.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1254 by ph10, Fri Feb 22 12:46:26 2013 UTC revision 1261 by ph10, Wed Feb 27 16:27:01 2013 UTC
# Line 1796  Returns:       TRUE  if the string is a Line 1796  Returns:       TRUE  if the string is a
1796                 FALSE otherwise                 FALSE otherwise
1797  */  */
1798    
1799  #ifdef NEVER  #ifdef NEVER   /* Not used */
   
1800  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
1801  static BOOL  static BOOL
1802  valid_utf32(pcre_uint32 *string, int length)  valid_utf32(pcre_uint32 *string, int length)
# Line 1808  register pcre_uint32 c; Line 1807  register pcre_uint32 c;
1807  for (p = string; length-- > 0; p++)  for (p = string; length-- > 0; p++)
1808    {    {
1809    c = *p;    c = *p;
1810      if (c > 0x10ffffu) return FALSE;                 /* Too big */
1811    if (c > 0x10ffffu)    if ((c & 0xfffff800u) == 0xd800u) return FALSE;  /* Surrogate */
     return FALSE;  
   
   /* A surrogate */  
   if ((c & 0xfffff800u) == 0xd800u)  
     return FALSE;  
   
   /* Non-character */  
   if ((c & 0xfffeu) == 0xfffeu || (c >= 0xfdd0u && c <= 0xfdefu))  
     return FALSE;  
1812    }    }
1813    
1814  return TRUE;  return TRUE;
1815  }  }
1816  #endif /* SUPPORT_UTF */  #endif /* SUPPORT_UTF */
   
1817  #endif /* NEVER */  #endif /* NEVER */
1818    #endif /* SUPPORT_PCRE32 */
1819    
1820    
 #endif  
   
1821  /*************************************************  /*************************************************
1822  *        Read or extend an input line            *  *        Read or extend an input line            *
1823  *************************************************/  *************************************************/

Legend:
Removed from v.1254  
changed lines
  Added in v.1261

  ViewVC Help
Powered by ViewVC 1.1.5