diff --git a/src/spec.rs b/src/spec.rs index b6238f90..e9cd6ea7 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -220,9 +220,12 @@ pub(crate) fn path_to_string>(path: T) -> String { let mut maybe_original = None; if let Some(original) = path.as_ref().to_str() { if (MAIN_SEPARATOR == '/' || !original.contains(MAIN_SEPARATOR)) - && !original.ends_with('.') + && !original.ends_with('.') + && !original.starts_with(['.', MAIN_SEPARATOR]) + && !original.starts_with(['.', '.', MAIN_SEPARATOR]) && !original.contains([MAIN_SEPARATOR, MAIN_SEPARATOR]) - && !original.contains(['.', MAIN_SEPARATOR]) { + && !original.contains([MAIN_SEPARATOR, '.', MAIN_SEPARATOR]) + && !original.contains([MAIN_SEPARATOR, '.', '.', MAIN_SEPARATOR]){ if original.starts_with(MAIN_SEPARATOR) { maybe_original = Some(&original[1..]); } else {