Fix files that don’t have a prefix
This commit is contained in:
parent
c754c1e9e2
commit
f4413b0969
3 changed files with 10 additions and 2 deletions
|
@ -44,7 +44,14 @@ impl FileAssociations {
|
|||
let this = cx.has_global::<Self>().then(|| cx.global::<Self>())?;
|
||||
|
||||
iife!({
|
||||
let suffix = path.extension()?.to_str()?;
|
||||
let suffix =
|
||||
path.file_name()
|
||||
.and_then(|os_str| os_str.to_str())
|
||||
.and_then(|file_name| {
|
||||
file_name
|
||||
.find('.')
|
||||
.and_then(|dot_index| file_name.get(dot_index + 1..))
|
||||
} )?;
|
||||
|
||||
this.suffixes
|
||||
.get(suffix)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue