Skip to content

Commit d1b260c

Browse files
committed
---
yaml --- r: 143812 b: refs/heads/try2 c: c14e14e h: refs/heads/master v: v3
1 parent f8c416c commit d1b260c

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 56730c094cf95be58fb05b0e423673aca2a98b88
8+
refs/heads/try2: c14e14e63aeefa5c94648dd921bd99a9dadeb060
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libstd/os.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ pub fn make_dir(p: &Path, mode: c_int) -> bool {
640640
use os::win32::as_utf16_p;
641641
// FIXME: turn mode into something useful? #2623
642642
do as_utf16_p(p.to_str()) |buf| {
643-
libc::CreateDirectoryW(buf, ptr::null() as LPCWSTR)
643+
libc::CreateDirectoryW(buf, ptr::mut_null())
644644
!= (0 as libc::BOOL)
645645
}
646646
}
@@ -1080,8 +1080,8 @@ pub fn last_os_error() -> ~str {
10801080

10811081
let mut buf = [0 as c_char, ..TMPBUF_SZ];
10821082

1083-
do buf.as_mut_buf |buf, len| {
1084-
unsafe {
1083+
unsafe {
1084+
do buf.as_mut_buf |buf, len| {
10851085
let res = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |
10861086
FORMAT_MESSAGE_IGNORE_INSERTS,
10871087
ptr::mut_null(),
@@ -1093,7 +1093,9 @@ pub fn last_os_error() -> ~str {
10931093
if res == 0 {
10941094
fail!("[%?] FormatMessage failure", errno());
10951095
}
1096+
}
10961097

1098+
do buf.as_imm_buf |buf, _len| {
10971099
str::raw::from_c_str(buf)
10981100
}
10991101
}

branches/try2/src/libstd/run.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use prelude::*;
2525
use ptr;
2626
use task;
2727
use vec::ImmutableVector;
28-
use vec;
2928

3029
/**
3130
* A value representing a child process.
@@ -691,6 +690,8 @@ fn spawn_process_os(prog: &str, args: &[~str],
691690

692691
#[cfg(unix)]
693692
fn with_argv<T>(prog: &str, args: &[~str], cb: &fn(**libc::c_char) -> T) -> T {
693+
use vec;
694+
694695
// We can't directly convert `str`s into `*char`s, as someone needs to hold
695696
// a reference to the intermediary byte buffers. So first build an array to
696697
// hold all the ~[u8] byte strings.
@@ -717,6 +718,8 @@ fn with_argv<T>(prog: &str, args: &[~str], cb: &fn(**libc::c_char) -> T) -> T {
717718

718719
#[cfg(unix)]
719720
fn with_envp<T>(env: Option<&[(~str, ~str)]>, cb: &fn(*c_void) -> T) -> T {
721+
use vec;
722+
720723
// On posixy systems we can pass a char** for envp, which is a
721724
// null-terminated array of "k=v\n" strings. Like `with_argv`, we have to
722725
// have a temporary buffer to hold the intermediary `~[u8]` byte strings.

0 commit comments

Comments
 (0)