Use quoteShell in stdlib, where appropriate.

This commit is contained in:
Michał Zieliński 2013-12-11 22:27:39 +01:00
commit 39cabcdd27
5 changed files with 30 additions and 31 deletions

View file

@ -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):