fn canonicalize(path: &Path, canonicalize: bool) -> PathBuf
Canonicalizes the given path. Returns the input path in case of an error.