From e679ed6ba484212cb860190dff06dafb8d9299b2 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sat, 22 Feb 2014 11:46:06 -0800 Subject: [PATCH] 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 d5d784cc2de32..9d10ce4b4850f 100644 --- a/src/librustc/back/archive.rs +++ b/src/librustc/back/archive.rs @@ -142,7 +142,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,