зеркало из https://github.com/mozilla/gecko-dev.git
Do classname-mangling correctly (or at least closer to correct, since
the code still does not handle unicode characters).
This commit is contained in:
Родитель
78f477adcf
Коммит
9006576ab5
|
@ -48,7 +48,7 @@ char *JNIShortMangler::mangle(const char *className,
|
||||||
|
|
||||||
bufptr += NameMangler::mangleUTFString(className, bufptr,
|
bufptr += NameMangler::mangleUTFString(className, bufptr,
|
||||||
bufend - bufptr,
|
bufend - bufptr,
|
||||||
NameMangler::mangleUTFJNI);
|
NameMangler::mangleUTFClass);
|
||||||
|
|
||||||
if (bufend - bufptr > 1)
|
if (bufend - bufptr > 1)
|
||||||
*bufptr++ = '_';
|
*bufptr++ = '_';
|
||||||
|
|
|
@ -58,6 +58,7 @@ Int32 NameMangler::mangleUnicodeChar(Int32 ch, char *bufptr, char *bufend)
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME - does not do UTF8 to unicode conversion - fur
|
||||||
Int32 NameMangler::mangleUTFString(const char *name,
|
Int32 NameMangler::mangleUTFString(const char *name,
|
||||||
char *buffer,
|
char *buffer,
|
||||||
int buflen,
|
int buflen,
|
||||||
|
@ -75,8 +76,11 @@ Int32 NameMangler::mangleUTFString(const char *name,
|
||||||
buffer[buflen-1] = '\0';
|
buffer[buflen-1] = '\0';
|
||||||
|
|
||||||
char *p = buffer;
|
char *p = buffer;
|
||||||
while ((p = strchr(p, '/')) != 0)
|
while (*p) {
|
||||||
*p = '_';
|
if ((*p == '/') || (*p == '.'))
|
||||||
|
*p = '_';
|
||||||
|
p++;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче