diff --git a/src/elements/script.rs b/src/elements/script.rs index 45a2590f..126bc9bd 100644 --- a/src/elements/script.rs +++ b/src/elements/script.rs @@ -89,14 +89,13 @@ impl Script { return Err(e); }, Status::NeedMoreLine => { - if ! feeder.feed_additional_line(core).is_ok() { - break; + let res = feeder.feed_additional_line(core); + if let Err(e) = res { + feeder.consume(feeder.len()); + return Err(e); } }, } } - - feeder.consume(feeder.len()); - Ok(None) } }