diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-02-22 11:46:06 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-02-24 21:22:26 -0800 |
| commit | 53b9484dafd92f442f8ed092e2648340c6cecf1f (patch) | |
| tree | e533d210211a69207f56e5b98737083079c1e25a | |
| parent | 8922fa01228f5161aa0ebd714f86f2712a3c7ea8 (diff) | |
| download | rust-53b9484dafd92f442f8ed092e2648340c6cecf1f.tar.gz rust-53b9484dafd92f442f8ed092e2648340c6cecf1f.zip | |
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
| -rw-r--r-- | src/librustc/back/archive.rs | 5 |
1 files changed, 4 insertions, 1 deletions
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, |
