Skip to content

Commit

Permalink
fix: absolute path computation
Browse files Browse the repository at this point in the history
  • Loading branch information
desbma committed Jan 17, 2025
1 parent f8402d8 commit 702ca50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/summarize/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ fn handle_chdir(
FdOrPath::Path(Expression::Buffer(BufferExpression {
value: b,
type_: BufferType::Unknown,
})) => Some(PathBuf::from(OsStr::from_bytes(b))),
})) => {
let p = Path::new(OsStr::from_bytes(b));
resolve_path(p, None, state.cur_dir.as_ref())
}
FdOrPath::Path(e) => {
return Err(HandlerError::ArgTypeMismatch {
sc_name: name.to_owned(),
Expand All @@ -97,6 +100,7 @@ fn handle_chdir(
}
};
if let Some(dir) = dir {
debug_assert!(dir.is_absolute());
state.cur_dir = Some(dir);
}
Ok(())
Expand Down
1 change: 1 addition & 0 deletions src/summarize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ impl Display for NetworkPort {
}
}

#[derive(Debug)]
enum FdOrPath<T> {
Fd(T),
Path(T),
Expand Down

0 comments on commit 702ca50

Please sign in to comment.