diff options
-rw-r--r-- | src/makefile/mod.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/makefile/mod.rs b/src/makefile/mod.rs index 4c39160..359355e 100644 --- a/src/makefile/mod.rs +++ b/src/makefile/mod.rs @@ -371,9 +371,13 @@ impl Makefile { let prerequisites = self.expand_macros(&prerequisites, None); let prerequisites = prerequisites.split_whitespace().map(|x| x.into()).collect::<Vec<String>>(); - while lines_iter.peek().and_then(|(_, x)| x.as_ref().ok()).map_or(false, |line| line.starts_with('\t')) { + while lines_iter.peek().and_then(|(_, x)| x.as_ref().ok()) + .map_or(false, |line| line.starts_with('\t') || line.is_empty()) { let line = lines_iter.next().unwrap().1.unwrap(); - let mut line: String = line.strip_prefix("\t").unwrap().into(); + let mut line: String = line.strip_prefix("\t").unwrap_or(&line).into(); + if line.is_empty() { + continue; + } while line.ends_with('\\') { match lines_iter.next() { Some((_, Ok(next_line))) => { |