Merge pull request #2968 from atom/ks-dont-quote-explorer-arguments

Don't quote certain explorer arguments
This commit is contained in:
Kevin Sawicki
2014-07-14 08:03:19 -07:00
2 changed files with 8 additions and 2 deletions

View File

@@ -102,7 +102,7 @@
"symbols-view": "0.60.0",
"tabs": "0.45.0",
"timecop": "0.21.0",
"tree-view": "0.109.0",
"tree-view": "0.110.0",
"update-package-dependencies": "0.6.0",
"welcome": "0.17.0",
"whitespace": "0.24.0",

View File

@@ -46,7 +46,13 @@ class BufferedProcess
if process.platform is "win32"
# Quote all arguments and escapes inner quotes
if args?
cmdArgs = args.map (arg) -> "\"#{arg.replace(/"/g, '\\"')}\""
cmdArgs = args.map (arg) ->
if command in ['explorer.exe', 'explorer'] and /^\/[a-zA-Z]+,.*$/.test(arg)
# Don't wrap /root,C:\folder style arguments to explorer calls in
# quotes since they will not be interpreted correctly if they are
arg
else
"\"#{arg.replace(/"/g, '\\"')}\""
else
cmdArgs = []
cmdArgs.unshift("\"#{command}\"")