aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/exec_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/syscall/exec_windows.go')
-rw-r--r--src/syscall/exec_windows.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/syscall/exec_windows.go b/src/syscall/exec_windows.go
index 500321ef0d..4a1d74ba3f 100644
--- a/src/syscall/exec_windows.go
+++ b/src/syscall/exec_windows.go
@@ -24,6 +24,9 @@ var ForkLock sync.RWMutex
// - finally, s is wrapped with double quotes (arg -> "arg"),
// but only if there is space or tab inside s.
func EscapeArg(s string) string {
+ if len(s) == 0 {
+ return `""`
+ }
for i := 0; i < len(s); i++ {
switch s[i] {
case '"', '\\', ' ', '\t':