зеркало из https://github.com/mozilla/pjs.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:
Родитель
3314e91b70
Коммит
d31d7c62f5
|
@ -48,7 +48,7 @@ char *JNIShortMangler::mangle(const char *className,
|
|||
|
||||
bufptr += NameMangler::mangleUTFString(className, bufptr,
|
||||
bufend - bufptr,
|
||||
NameMangler::mangleUTFJNI);
|
||||
NameMangler::mangleUTFClass);
|
||||
|
||||
if (bufend - bufptr > 1)
|
||||
*bufptr++ = '_';
|
||||
|
|
|
@ -58,6 +58,7 @@ Int32 NameMangler::mangleUnicodeChar(Int32 ch, char *bufptr, char *bufend)
|
|||
return len;
|
||||
}
|
||||
|
||||
// FIXME - does not do UTF8 to unicode conversion - fur
|
||||
Int32 NameMangler::mangleUTFString(const char *name,
|
||||
char *buffer,
|
||||
int buflen,
|
||||
|
@ -75,8 +76,11 @@ Int32 NameMangler::mangleUTFString(const char *name,
|
|||
buffer[buflen-1] = '\0';
|
||||
|
||||
char *p = buffer;
|
||||
while ((p = strchr(p, '/')) != 0)
|
||||
*p = '_';
|
||||
while (*p) {
|
||||
if ((*p == '/') || (*p == '.'))
|
||||
*p = '_';
|
||||
p++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче