From 53b9484dafd92f442f8ed092e2648340c6cecf1f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sat, 22 Feb 2014 11:46:06 -0800 Subject: Use lines_any() when parsing output form "ar" On windows lines are delimited with \r\n while on unix they're delimited with \n. cc #12471 --- src/librustc/back/archive.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/librustc/back/archive.rs b/src/librustc/back/archive.rs index 1df34576c3e..e0c570664fe 100644 --- a/src/librustc/back/archive.rs +++ b/src/librustc/back/archive.rs @@ -145,7 +145,10 @@ impl Archive { /// Lists all files in an archive pub fn files(&self) -> ~[~str] { let output = run_ar(self.sess, "t", None, [&self.dst]); - str::from_utf8(output.output).unwrap().lines().map(|s| s.to_owned()).collect() + let output = str::from_utf8(output.output).unwrap(); + // use lines_any because windows delimits output with `\r\n` instead of + // just `\n` + output.lines_any().map(|s| s.to_owned()).collect() } fn add_archive(&mut self, archive: &Path, name: &str, -- cgit 1.4.1-3-g733a5