fixed unsafe shell call on windows (#8372)
This commit is contained in:
parent
1356d6d8d5
commit
0a170efaa5
@ -23,12 +23,14 @@ pub fn open(url: &str) {
|
||||
use winapi::um::shellapi::ShellExecuteA;
|
||||
use winapi::um::winuser::SW_SHOWNORMAL as Normal;
|
||||
|
||||
ShellExecuteA(ptr::null_mut(),
|
||||
CString::new("open").unwrap().as_ptr(),
|
||||
CString::new(url.to_owned().replace("\n", "%0A")).unwrap().as_ptr(),
|
||||
ptr::null(),
|
||||
ptr::null(),
|
||||
Normal);
|
||||
unsafe {
|
||||
ShellExecuteA(ptr::null_mut(),
|
||||
CString::new("open").unwrap().as_ptr(),
|
||||
CString::new(url.to_owned().replace("\n", "%0A")).unwrap().as_ptr(),
|
||||
ptr::null(),
|
||||
ptr::null(),
|
||||
Normal);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(target_os="macos", target_os="freebsd"))]
|
||||
|
Loading…
Reference in New Issue
Block a user