Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
fixed unsafe shell call on windows (#8372)
Browse files Browse the repository at this point in the history
  • Loading branch information
debris authored and andresilva committed Apr 11, 2018
1 parent 1356d6d commit 0a170ef
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions parity/url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))]
Expand Down

0 comments on commit 0a170ef

Please sign in to comment.