Skip to content

Commit

Permalink
Strip empty strings from link args
Browse files Browse the repository at this point in the history
Closes #15487
  • 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() {}

5 comments on commit 12b3498

@bors
Copy link
Contributor

@bors bors commented on 12b3498 Jul 7, 2014

Choose a reason for hiding this comment

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

saw approval from alexcrichton
at sfackler@12b3498

@bors
Copy link
Contributor

@bors bors commented on 12b3498 Jul 7, 2014

Choose a reason for hiding this comment

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

merging sfackler/rust/link_args_spaces = 12b3498 into auto

@bors
Copy link
Contributor

@bors bors commented on 12b3498 Jul 7, 2014

Choose a reason for hiding this comment

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

sfackler/rust/link_args_spaces = 12b3498 merged ok, testing candidate = 49bc17b

@bors
Copy link
Contributor

@bors bors commented on 12b3498 Jul 7, 2014

Choose a reason for hiding this comment

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

fast-forwarding master to auto = 49bc17b

Please sign in to comment.