diff options
| author | Ian Lance Taylor <iant@golang.org> | 2020-10-07 11:15:01 -0700 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2020-10-08 20:46:25 +0000 |
| commit | 9e0837f2e9967b883bebf4b8928108d9199ae677 (patch) | |
| tree | a61098328dd31eea4323cbb7acb5d24f262659b8 /src/syscall/exec_windows.go | |
| parent | a4b95cd092aa10b40c6be82a3e0bf1052e27122d (diff) | |
| download | go-9e0837f2e9967b883bebf4b8928108d9199ae677.tar.xz | |
syscall: restore EscapeArg behavior for empty string
Accidentally broken by CL 259978.
For #41825
Change-Id: Id663514e6eefa325faccdb66493d0bb2b3281046
Reviewed-on: https://go-review.googlesource.com/c/go/+/260397
Trust: Ian Lance Taylor <iant@golang.org>
Trust: Alex Brainman <alex.brainman@gmail.com>
Trust: Emmanuel Odeke <emm.odeke@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/syscall/exec_windows.go')
| -rw-r--r-- | src/syscall/exec_windows.go | 3 |
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': |
