Handle backslashed paths in the DME on Unix

This commit is contained in:
Tad Hardesty 2018-01-22 11:18:32 -08:00
parent 1a652f39a2
commit 0a3b9c82f3
2 changed files with 3 additions and 2 deletions

View file

@ -350,7 +350,10 @@ impl Preprocessor {
"include" => {
expect_token!((path) = Token::String(path));
expect_token!(() = Token::Punct(Punctuation::Newline));
#[cfg(windows)]
let path = PathBuf::from(path);
#[cfg(unix)]
let path = PathBuf::from(path.replace("\\", "/"));
for each in vec![
self.env_file.parent().unwrap().join(&path),

View file

@ -5,8 +5,6 @@ use std::borrow::Cow;
#[cfg(unix)]
pub fn fix_case(path: &Path) -> Cow<Path> {
use std::ascii::AsciiExt;
if path.exists() {
return Cow::Borrowed(path);
}