Skip to content

Commit

Permalink
Fix mtllib file name parsing bug for paths including spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
joshlengel authored Mar 26, 2024
1 parent 7ebb579 commit f5a11b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1742,7 +1742,8 @@ where
}
}
Some("mtllib") => {
if let Some(mtllib) = words.next() {
// File name can include spaces so we cannot rely on a SplitWhitespace iterator
if let Some(mtllib) = line.split_once(' ').unwrap_or_default().1.trim() {
let mat_file = Path::new(mtllib).to_path_buf();
match material_loader(mat_file.as_path()) {
Ok((mut mats, map)) => {
Expand Down

0 comments on commit f5a11b4

Please sign in to comment.