WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Quick and dirty fix, no change log, no test
11849_r0.patch (text/plain), 1.66 KB, created by
mitz
on 2006-12-28 07:24:38 PST
(
hide
)
Description:
Quick and dirty fix, no change log, no test
Filename:
MIME Type:
Creator:
mitz
Created:
2006-12-28 07:24:38 PST
Size:
1.66 KB
patch
obsolete
>Index: JavaScriptCore/kjs/regexp.cpp >=================================================================== >--- JavaScriptCore/kjs/regexp.cpp (revision 18449) >+++ JavaScriptCore/kjs/regexp.cpp (working copy) >@@ -47,9 +47,8 @@ RegExp::RegExp(const UString &p, int fla > const char *errorMessage; > int errorOffset; > >- UString pattern(p); >+ UString pattern = escapeNullsAndTerminatePattern(p); > >- pattern.append('\0'); > m_regex = pcre_compile(reinterpret_cast<const uint16_t*>(pattern.data()), > options, &errorMessage, &errorOffset, NULL); > if (!m_regex) { >@@ -192,6 +191,27 @@ UString RegExp::match(const UString &s, > #endif > } > >+UString RegExp::escapeNullsAndTerminatePattern(const UString& p) >+{ >+ UString newPattern; >+ >+ int startPos = 0; >+ int pos = p.find(static_cast<UChar>('\0'), 0); >+ >+ >+ while (pos != -1) { >+ newPattern.append(p.substr(startPos, pos - startPos)); >+ newPattern.append("\\x00"); >+ >+ startPos = pos + 1; >+ pos = p.find(static_cast<UChar>('\0'), pos + 1); >+ } >+ newPattern.append(p.substr(startPos, p.size() - startPos)); >+ newPattern.append('\0'); >+ >+ return newPattern; >+} >+ > UString RegExp::sanitizePattern(const UString& p) > { > UString newPattern; >Index: JavaScriptCore/kjs/regexp.h >=================================================================== >--- JavaScriptCore/kjs/regexp.h (revision 18449) >+++ JavaScriptCore/kjs/regexp.h (working copy) >@@ -65,6 +65,7 @@ namespace KJS { > RegExp(const RegExp &); > RegExp &operator=(const RegExp &); > >+ static UString escapeNullsAndTerminatePattern(const UString&); > static UString sanitizePattern(const UString&); > > static bool isHexDigit(UChar);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 11849
:
12081
|
12088
|
12092
|
12106
|
12112
|
12144
|
12164