| 6 |
and semantics are as close as possible to those of the Perl 5 language. |
and semantics are as close as possible to those of the Perl 5 language. |
| 7 |
|
|
| 8 |
Written by Philip Hazel |
Written by Philip Hazel |
| 9 |
Copyright (c) 1997-2008 University of Cambridge |
Copyright (c) 1997-2009 University of Cambridge |
| 10 |
|
|
| 11 |
----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
| 12 |
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
| 75 |
*/ |
*/ |
| 76 |
|
|
| 77 |
int |
int |
| 78 |
_pcre_valid_utf8(const uschar *string, int length) |
_pcre_valid_utf8(USPTR string, int length) |
| 79 |
{ |
{ |
| 80 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
| 81 |
register const uschar *p; |
register USPTR p; |
| 82 |
|
|
| 83 |
if (length < 0) |
if (length < 0) |
| 84 |
{ |
{ |
| 154 |
if ((*(++p) & 0xc0) != 0x80) return p - string; |
if ((*(++p) & 0xc0) != 0x80) return p - string; |
| 155 |
} |
} |
| 156 |
} |
} |
| 157 |
|
#else |
| 158 |
|
(void)(string); /* Keep picky compilers happy */ |
| 159 |
|
(void)(length); |
| 160 |
#endif |
#endif |
| 161 |
|
|
| 162 |
return -1; |
return -1; |