aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-03-26 21:30:49 -0600
committerMelody Horn <melody@boringcactus.com>2021-03-26 21:30:49 -0600
commit65e4eb4c1aea40b98595ea5ad88b6e8cde8fe473 (patch)
treeccba065f5c38beb530374057c274815689fe3275
parent9d252beea27dc6b3f8b8a938375a17f291cdad2b (diff)
downloadmakers-65e4eb4c1aea40b98595ea5ad88b6e8cde8fe473.tar.gz
makers-65e4eb4c1aea40b98595ea5ad88b6e8cde8fe473.zip
allow blank lines in rules
-rw-r--r--src/makefile/mod.rs8
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))) => {