Skip to content

Commit 53b9484

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 8922fa0 commit 53b9484

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/librustc/back/archive.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ impl Archive {
145145
/// Lists all files in an archive
146146
pub fn files(&self) -> ~[~str] {
147147
let output = run_ar(self.sess, "t", None, [&self.dst]);
148-
str::from_utf8(output.output).unwrap().lines().map(|s| s.to_owned()).collect()
148+
let output = str::from_utf8(output.output).unwrap();
149+
// use lines_any because windows delimits output with `\r\n` instead of
150+
// just `\n`
151+
output.lines_any().map(|s| s.to_owned()).collect()
149152
}
150153

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

0 commit comments

Comments
 (0)