/* Parse through the locale name */
name_start = p;
- while (isGRAPH(*p) && *p != ';') {
+ while (p < e && *p != ';') {
+ if (! isGRAPH(*p)) {
+ Perl_croak(aTHX_
+ "panic: %s: %d: Unexpected character in locale name '%02X",
+ __FILE__, __LINE__, *(p-1));
+ }
p++;
}
name_end = p;
- if (*p++ != ';') {
- Perl_croak(aTHX_
- "panic: %s: %d: Unexpected character in locale name '%02X",
- __FILE__, __LINE__, *(p-1));
+ /* Space past the semi-colon */
+ if (p < e) {
+ p++;
}
/* Find the index of the category name in our lists */
}
assert(category == LC_ALL);
- individ_locale = Perl_form(aTHX_ "%.*s", (int) (p - s), s);
+ individ_locale = Perl_form(aTHX_ "%.*s",
+ (int) (name_end - name_start), name_start);
if (! emulate_setlocale(categories[i], individ_locale, i, TRUE))
{
return NULL;
}
+ {
+ fresh_perl(<<"EOF",
+ use locale;
+ use POSIX;
+ POSIX::setlocale(LC_ALL, "LC_NUMERIC=de_DE.utf8;LC_CTYPE=de_DE.utf8;LC_COLLATE=de_DE.utf8;LC_TIME=de_DE.utf8;LC_MESSAGES=de_DE.utf8;LC_MONETARY=de_DE.utf8;LC_ADDRESS=de_DE.utf8;LC_IDENTIFICATION=de_DE.utf8;LC_MEASUREMENT=de_DE.utf8;LC_PAPER=de_DE.utf8;LC_TELEPHONE=de_DE.utf8");
+EOF
+ {});
+ ok ($? == 0, "In complicated LC_ALL, final individ category doesn't need a \';'");
+
+ }
+
# IMPORTANT: When adding tests before the following line, be sure to update
# its skip count:
# skip("no locale available where LC_NUMERIC makes a difference", ...)
-sub last { 37 }
+sub last { 38 }