Skip to content

Commit

Permalink
Strip empty strings from link args
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Jul 7, 2014
1 parent 4f120e6 commit 12b3498
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc/metadata/cstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ impl CStore {
}

pub fn add_used_link_args(&self, args: &str) {
for s in args.split(' ') {
for s in args.split(' ').filter(|s| !s.is_empty()) {
self.used_link_args.borrow_mut().push(s.to_string());
}
}
Expand Down
20 changes: 20 additions & 0 deletions src/test/run-pass/issue-15487.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// ignore-win32

#![feature(link_args)]

#[link_args="-lc -lm"]
#[link_args=" -lc"]
#[link_args="-lc "]
extern {}

fn main() {}

1 comment on commit 12b3498

@sfackler
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=alexcrichton

Please sign in to comment.