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
This commit is contained in:
Alex Crichton 2014-02-22 11:46:06 -08:00
parent 8922fa0122
commit 53b9484daf
1 changed files with 4 additions and 1 deletions

View File

@ -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,