~strify win32-specific fns

This commit is contained in:
Niko Matsakis 2012-07-14 18:28:20 -07:00
parent 3ef7ff8b89
commit 54cd5e1814
3 changed files with 9 additions and 9 deletions

View File

@ -5,21 +5,21 @@ import libc::{c_int, pid_t};
export run;
#[cfg(target_os = "win32")]
fn target_env(lib_path: str, prog: str) -> ~[(str,str)] {
fn target_env(lib_path: ~str, prog: ~str) -> ~[(~str,~str)] {
let mut env = os::env();
// Make sure we include the aux directory in the path
assert prog.ends_with(".exe");
let aux_path = prog.slice(0u, prog.len() - 4u) + ".libaux";
assert prog.ends_with(~".exe");
let aux_path = prog.slice(0u, prog.len() - 4u) + ~".libaux";
env = do vec::map(env) |pair| {
let (k,v) = pair;
if k == "PATH" { ("PATH", v + ";" + lib_path + ";" + aux_path) }
if k == ~"PATH" { (~"PATH", v + ~";" + lib_path + ~";" + aux_path) }
else { (k,v) }
};
if str::ends_with(prog, "rustc.exe") {
vec::push(env, ("RUST_THREADS", "1"));
if str::ends_with(prog, ~"rustc.exe") {
vec::push(env, (~"RUST_THREADS", ~"1"));
}
ret env;
}

View File

@ -434,9 +434,9 @@ fn make_cmdline(_libpath: ~str, prog: ~str, args: ~[~str]) -> ~str {
}
#[cfg(target_os = "win32")]
fn make_cmdline(libpath: str, prog: str, args: ~[str]) -> str {
fn make_cmdline(libpath: ~str, prog: ~str, args: ~[~str]) -> ~str {
#fmt["%s %s %s", lib_path_cmd_prefix(libpath), prog,
str::connect(args, " ")]
str::connect(args, ~" ")]
}
// Build the LD_LIBRARY_PATH variable as it would be seen on the command line

View File

@ -31,7 +31,7 @@ fn lib_path_env_var() -> ~str { ~"PATH" }
fn path_div() -> ~str { ~":" }
#[cfg(target_os = "win32")]
fn path_div() -> str { ~";" }
fn path_div() -> ~str { ~";" }
fn logv(config: config, s: ~str) {
log(debug, s);