utf16 string unboxing tweak

cvs
Slava Pestov 2005-09-03 21:59:53 +00:00
parent 55a4de3120
commit 74430b8b18
2 changed files with 6 additions and 2 deletions

View File

@ -64,7 +64,7 @@
FactorPlugin.evalInListener(view, FactorPlugin.evalInListener(view,
"\"" "\""
+ FactorReader.charsToEscapes(word) + FactorReader.charsToEscapes(word)
+ "\" apropos."); + "\" apropos");
} }
</CODE> </CODE>
</ACTION> </ACTION>

View File

@ -163,7 +163,11 @@ char* unbox_c_string(void)
u16* unbox_utf16_string(void) u16* unbox_utf16_string(void)
{ {
/* Return pointer to first character */ /* Return pointer to first character */
return (u16*)(untag_string(dpop()) + 1); CELL str = dpop();
if(type_of(str) == STRING_TYPE)
return (u16*)(untag_string(str) + 1);
else
return (u16*)alien_offset(str);
} }
void primitive_char_slot(void) void primitive_char_slot(void)