Use quoteShell in stdlib, where appropriate.
This commit is contained in:
parent
c363197275
commit
39cabcdd27
5 changed files with 30 additions and 31 deletions
|
|
@ -33,10 +33,10 @@ proc openDefaultBrowser*(url: string) =
|
|||
else:
|
||||
discard ShellExecuteA(0'i32, "open", url, nil, nil, SW_SHOWNORMAL)
|
||||
elif defined(macosx):
|
||||
discard execShellCmd("open " & quoteIfContainsWhite(url))
|
||||
discard execShellCmd("open " & quoteShell(url))
|
||||
else:
|
||||
const attempts = ["gnome-open ", "kde-open ", "xdg-open "]
|
||||
var u = quoteIfContainsWhite(url)
|
||||
var u = quoteShell(url)
|
||||
for a in items(attempts):
|
||||
if execShellCmd(a & u) == 0: return
|
||||
for b in getEnv("BROWSER").string.split(PathSep):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue