#define PL_stderrgv (vTHX->Istderrgv)
#define PL_stdingv (vTHX->Istdingv)
#define PL_strtab (vTHX->Istrtab)
+#define PL_strxfrm_NUL_replacement (vTHX->Istrxfrm_NUL_replacement)
#define PL_strxfrm_is_behaved (vTHX->Istrxfrm_is_behaved)
#define PL_strxfrm_max_cp (vTHX->Istrxfrm_max_cp)
-#define PL_strxfrm_min_char (vTHX->Istrxfrm_min_char)
#define PL_sub_generation (vTHX->Isub_generation)
#define PL_subline (vTHX->Isubline)
#define PL_subname (vTHX->Isubname)
PERLVAR(I, collxfrm_base, Size_t) /* Basic overhead in *xfrm() */
PERLVARI(I, collxfrm_mult,Size_t, 2) /* Expansion factor in *xfrm() */
PERLVARI(I, collation_ix, U32, 0) /* Collation generation index */
-PERLVARI(I, strxfrm_min_char, U8, 0) /* Code point that sorts earliest in
- locale */
+PERLVARI(I, strxfrm_NUL_replacement, U8, 0) /* Code point to replace NULs */
PERLVARI(I, strxfrm_is_behaved, bool, TRUE)
/* Assume until proven otherwise that it works */
PERLVARI(I, strxfrm_max_cp, U8, 0) /* Highest collating cp in locale */
PL_collxfrm_base = 0;
PL_collxfrm_mult = 2;
PL_in_utf8_COLLATE_locale = FALSE;
- PL_strxfrm_min_char = '\0';
+ PL_strxfrm_NUL_replacement = '\0';
PL_strxfrm_max_cp = 0;
return;
}
}
PL_in_utf8_COLLATE_locale = _is_cur_LC_category_utf8(LC_COLLATE);
- PL_strxfrm_min_char = '\0';
+ PL_strxfrm_NUL_replacement = '\0';
PL_strxfrm_max_cp = 0;
/* A locale collation definition includes primary, secondary, tertiary,
/* If we don't know what non-NUL control character sorts lowest for
* this locale, find it */
- if (PL_strxfrm_min_char == '\0') {
+ if (PL_strxfrm_NUL_replacement == '\0') {
int j;
char * cur_min_x = NULL; /* The min_char's xfrm, (except it also
includes the collation index
|| strLT(x + COLLXFRM_HDR_LEN,
cur_min_x + COLLXFRM_HDR_LEN))
{
- PL_strxfrm_min_char = j;
+ PL_strxfrm_NUL_replacement = j;
cur_min_x = x;
}
else {
DEBUG_L(PerlIO_printf(Perl_debug_log,
"_mem_collxfrm: Replacing embedded NULs in locale %s with "
- "0x%02X\n", PL_collation_name, PL_strxfrm_min_char));
+ "0x%02X\n", PL_collation_name, PL_strxfrm_NUL_replacement));
Safefree(cur_min_x);
} /* End of determining the character that is to replace NULs */
/* If the replacement is variant under UTF-8, it must match the
* UTF8-ness as the original */
- if ( ! UVCHR_IS_INVARIANT(PL_strxfrm_min_char) && utf8) {
- this_replacement_char[0] = UTF8_EIGHT_BIT_HI(PL_strxfrm_min_char);
- this_replacement_char[1] = UTF8_EIGHT_BIT_LO(PL_strxfrm_min_char);
+ if ( ! UVCHR_IS_INVARIANT(PL_strxfrm_NUL_replacement) && utf8) {
+ this_replacement_char[0] =
+ UTF8_EIGHT_BIT_HI(PL_strxfrm_NUL_replacement);
+ this_replacement_char[1] =
+ UTF8_EIGHT_BIT_LO(PL_strxfrm_NUL_replacement);
this_replacement_len = 2;
}
else {
- this_replacement_char[0] = PL_strxfrm_min_char;
+ this_replacement_char[0] = PL_strxfrm_NUL_replacement;
/* this_replacement_char[1] = '\0' was done at initialization */
this_replacement_len = 1;
}