pub fn is_safe_component(name: &str) -> boolExpand description
Returns true if name is a single, normal path component that is safe to
join onto a directory.
Rejects empty strings, absolute paths, ./.., and any value containing a
path separator. Use this for untrusted values that become a path component,
such as repository names or package provides entries, where a join must
not escape its base directory.
ยงExample
use soar_utils::path::is_safe_component;
assert!(is_safe_component("soarpkgs"));
assert!(!is_safe_component("../etc"));