~ubuntu-branches/ubuntu/karmic/erlang/karmic-security

« back to all changes in this revision

Viewing changes to erts/emulator/pcre/pcre_valid_utf8.c

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-05-01 10:14:38 UTC
  • mfrom: (3.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090501101438-6qlr6rsdxgyzrg2z
Tags: 1:13.b-dfsg-2
* Cleaned up patches: removed unneeded patch which helped to support
  different SCTP library versions, made sure that changes for m68k
  architecture applied only when building on this architecture.
* Removed duplicated information from binary packages descriptions.
* Don't require libsctp-dev build-dependency on solaris-i386 architecture
  which allows to build Erlang on Nexenta (thanks to Tim Spriggs for
  the suggestion).

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
/* This module contains an internal function for validating UTF-8 character
42
42
strings. */
43
43
 
 
44
/* %ExternalCopyright% */
44
45
 
45
46
#ifdef HAVE_CONFIG_H
46
47
#include "config.h"
75
76
*/
76
77
 
77
78
int
78
 
_pcre_valid_utf8(const uschar *string, int length)
 
79
_erts_pcre_valid_utf8(const uschar *string, int length)
79
80
{
80
81
#ifdef SUPPORT_UTF8
81
82
register const uschar *p;
92
93
  register int c = *p;
93
94
  if (c < 128) continue;
94
95
  if (c < 0xc0) return p - string;
95
 
  ab = _pcre_utf8_table4[c & 0x3f];     /* Number of additional bytes */
 
96
  ab = _erts_pcre_utf8_table4[c & 0x3f];     /* Number of additional bytes */
96
97
  if (length < ab || ab > 3) return p - string;
97
98
  length -= ab;
98
99