Skip to content

Commit

Permalink
Fix .depenv file parsing after #329 (#367)
Browse files Browse the repository at this point in the history
It failed to parse empty depenv files due to how 'split' function works.
  • Loading branch information
a1ph authored Jul 3, 2020
1 parent d2c4b14 commit 83962c9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cargo/cargo_build_script_runner/bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ fn main() -> Result<(), String> {
while let Some(dep_env_path) = args.next() {
if let Ok(contents) = read_to_string(dep_env_path) {
for line in contents.split('\n') {
// split on empty contents will still produce a single empty string in iterable.
if line.is_empty() {
continue;
}
let mut key_val = line.splitn(2, '=');
match (key_val.next(), key_val.next()) {
(Some(key), Some(value)) => {
Expand Down

0 comments on commit 83962c9

Please # to comment.