pub fn patcompstart()Expand description
Port of patcompstart() from Src/pattern.c:517.
Resets per-compile globals. Called at the start of patcompile.
C body (c:517-526) — strict order matters:
patcompcharsset()— must run FIRST so the zpc_special table reflects the current option state before parsing.patglobflags = isset(CASEGLOB) || isset(CASEPATHS) ? 0 : GF_IGNCASE;— case-insensitivity is the default UNLESS one of the case-sensitive options is set.if (isset(MULTIBYTE)) patglobflags |= GF_MULTIBYTE;— multibyte handling is option-gated, NOT unconditional.
The previous Rust port had three divergences: (a) called
patcompcharsset LAST instead of FIRST, (b) unconditionally set
GF_MULTIBYTE even when setopt nomultibyte, (c) NEVER set
GF_IGNCASE — setopt nocaseglob had zero effect on pattern
case-folding.