Skip to content

Empty arguments to processes aren't handled correctly on windows #16272

Closed
@alexcrichton

Description

@alexcrichton

For example, this program prints "1\n3" on unix, and "1\n2" on windows:

use std::io::{process, Command};
use std::os;

fn main() {
    let len = os::args().len();
    println!("{}", len);

    if len == 1 {
        Command::new(os::self_exe_name().unwrap())
                .arg("foo").arg("")
                .stdout(process::InheritFd(1))
                .spawn().unwrap();
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions