Skip to content

Commit e679ed6

Browse files
committed
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
1 parent eb5ba4d commit e679ed6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/librustc/back/archive.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ impl Archive {
142142
/// Lists all files in an archive
143143
pub fn files(&self) -> ~[~str] {
144144
let output = run_ar(self.sess, "t", None, [&self.dst]);
145-
str::from_utf8(output.output).unwrap().lines().map(|s| s.to_owned()).collect()
145+
let output = str::from_utf8(output.output).unwrap();
146+
// use lines_any because windows delimits output with `\r\n` instead of
147+
// just `\n`
148+
output.lines_any().map(|s| s.to_owned()).collect()
146149
}
147150

148151
fn add_archive(&mut self, archive: &Path, name: &str,

0 commit comments

Comments
 (0)