chromium 11.0.969.72
[chromium.git] / patches / patch-third__party_WebKit_Source_WebCore_bindings_v8_V8Proxy.cpp
1 $NetBSD$
2
3 --- third_party/WebKit/Source/WebCore/bindings/v8/V8Proxy.cpp.orig      2011-04-13 08:12:33.000000000 +0000
4 +++ third_party/WebKit/Source/WebCore/bindings/v8/V8Proxy.cpp
5 @@ -812,7 +812,34 @@ int V8Proxy::contextDebugId(v8::Handle<v
6      if (!context->GetData()->IsString())
7          return -1;
8      v8::String::AsciiValue ascii(context->GetData());
9 +#if defined(OS_NETBSD)
10 +    const char *s = *ascii;
11 +    const char *find = ",";
12 +    size_t flen, len = ascii.length();
13 +    char c, sc;
14 +    char *comma = (char *)s;
15 +
16 +    if ((c = *find++) != '\0') {
17 +        flen = strlen(find);
18 +        do {
19 +            do {
20 +                if (len-- < 1 || (sc = *s++) == '\0') {
21 +                    comma = NULL;
22 +                    break;
23 +                }
24 +            } while (sc != c);
25 +            if (flen > len) {
26 +                comma = NULL;
27 +                break;
28 +            }
29 +        } while (strncmp(s, find, flen) != 0);
30 +        s--;
31 +    }
32 +    if (comma != NULL)
33 +        comma = (char *)s;
34 +#else
35      char* comma = strnstr(*ascii, ",", ascii.length());
36 +#endif
37      if (!comma)
38          return -1;
39      return atoi(comma + 1);