if (category == LC_ALL) {
char * individ_locale = Perl_form(aTHX_ "%.*s", (int) (p - s), s);
emulate_setlocale(categories[i], individ_locale, i, TRUE);
- Safefree(individ_locale);
}
}
# endif
if (! uselocale(old_obj)) {
- SAVE_ERRNO;
# ifdef DEBUGGING
if (UNLIKELY(bad_count) && PL_in_utf8_CTYPE_locale) {
PL_warn_locale = Perl_newSVpvf(aTHX_
"Locale '%s' contains (at least) the following characters"
- " which have\nnon-standard meanings: %s\nThe Perl program"
- " will use the standard meanings",
+ " which have\nunexpected meanings: %s\nThe Perl program"
+ " will use the expected meanings",
newctype, bad_chars_list);
-
}
else {
PL_warn_locale = Perl_newSVpvf(aTHX_
=item *
-It delivers the correct results for the C<RADIXCHAR> and C<THOUSESEP> items,
+It delivers the correct results for the C<RADIXCHAR> and C<THOUSEP> items,
without you having to write extra code. The reason for the extra code would be
because these are from the C<LC_NUMERIC> locale category, which is normally
kept set to the C locale by Perl, no matter what the underlying locale is
{ /* khw couldn't figure out how the localedef specifications
would show that the $ should replace the radix; this is
just a guess as to how it might work.*/
- retval = ".";
+ PL_langinfo_buf[0] = '.';
}
else if (lc->p_cs_precedes) {
- retval = "-";
+ PL_langinfo_buf[0] = '-';
}
else {
- retval = "+";
+ PL_langinfo_buf[0] = '+';
}
LOCALE_UNLOCK;
LOCALE_UNLOCK;
+ retval = PL_langinfo_buf;
+
/* If to return the format, not the value, overwrite the buffer
* with it. But some strftime()s will keep the original format
* if illegal, so change those to "" */
if (return_format) {
if (strEQ(PL_langinfo_buf, format)) {
*PL_langinfo_buf = '\0';
- retval = PL_langinfo_buf;
}
else {
retval = save_to_buffer(format, &PL_langinfo_buf,