mirror of
https://github.com/sxyazi/yazi.git
synced 2025-01-03 14:24:33 +03:00
fix: match_mime()
should return true if pattern is "*"
This commit is contained in:
parent
4c46862506
commit
b81b707a3e
@ -13,7 +13,9 @@ pub struct Pattern {
|
||||
|
||||
impl Pattern {
|
||||
#[inline]
|
||||
pub fn match_mime(&self, str: impl AsRef<str>) -> bool { self.inner.is_match(str.as_ref()) }
|
||||
pub fn match_mime(&self, str: impl AsRef<str>) -> bool {
|
||||
self.is_star || self.inner.is_match(str.as_ref())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn match_path(&self, path: impl AsRef<Path>, is_dir: bool) -> bool {
|
||||
@ -36,7 +38,7 @@ impl TryFrom<&str> for Pattern {
|
||||
|
||||
let inner = GlobBuilder::new(b)
|
||||
.case_insensitive(a.len() == s.len())
|
||||
.literal_separator(true)
|
||||
.literal_separator(false)
|
||||
.backslash_escape(false)
|
||||
.empty_alternates(true)
|
||||
.build()?
|
||||
|
Loading…
Reference in New Issue
Block a user