提交 58d157c2 编写于 作者: C Corey Butler

Use filepath.join to escape whitespace

上级 506a57d4
......@@ -375,7 +375,7 @@ func use(version string, cpuarch string) {
// Create or update the symlink
sym, _ := os.Stat(env.symlink)
if sym != nil {
cmd := exec.Command(filepath.Join(env.root, "elevate.cmd"), "cmd", "/C", "rmdir", env.symlink)
cmd := exec.Command(filepath.Join(env.root, "elevate.cmd"), "cmd", "/C", "rmdir", filepath.Clean(env.symlink))
var output bytes.Buffer
var _stderr bytes.Buffer
cmd.Stdout = &output
......@@ -387,7 +387,7 @@ func use(version string, cpuarch string) {
}
}
c := exec.Command(filepath.Join(env.root, "elevate.cmd"), "cmd", "/C", "mklink", "/D", env.symlink, filepath.Join(env.root, "v"+version))
c := exec.Command(filepath.Join(env.root, "elevate.cmd"), "cmd", "/C", "mklink", "/D", filepath.Clean(env.symlink), filepath.Join(env.root, "v"+version))
var out bytes.Buffer
var stderr bytes.Buffer
c.Stdout = &out
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册