Skip to content

Commit

Permalink
check lowercase extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
griccardos committed Sep 29, 2023
1 parent c33b0c3 commit aa3a192
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions librusl/src/extended.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::panic::catch_unwind;
use std::path::Path;
pub trait ExtendedTrait {
fn name(&self) -> String;
///lowercase extensions
fn extensions(&self) -> Vec<String>;
fn to_string(&self, path: &Path) -> Result<String, Box<dyn std::error::Error>>;
}
Expand Down
2 changes: 1 addition & 1 deletion librusl/src/rgtools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fn read_file(

//apply each of extensions
if ops.extended {
let extension = path.extension().unwrap_or_default().to_string_lossy().to_string();
let extension = path.extension().unwrap_or_default().to_string_lossy().to_lowercase();
let extendeds = vec![ExtendedType::Pdf, ExtendedType::Office];
for ext in extendeds.iter().filter(|a| a.extensions().contains(&extension)) {
if let Ok(data) = ext.to_string(&path) {
Expand Down

0 comments on commit aa3a192

Please sign in to comment.