Files
coreutils/src
Wei Li 3db0433c41 dircolors: don't panic on an invalid TERM/COLORTERM glob (#12728)
A database file with a TERM/COLORTERM line whose value is an invalid glob
(e.g. an unclosed `[`) aborted dircolors with a Result::unwrap panic:
`fnmatch` did `parse_glob::from_str(pat).unwrap().matches(self)`, and
from_str returns Err for an unparseable pattern.

Use `is_ok_and`, so an invalid glob is treated as a non-match (and the
unmatched TERM section is skipped) instead of crashing — matching GNU, which
emits an empty LS_COLORS and exits 0.
2026-06-09 22:16:55 +02:00
..