diff options
author | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | 2021-05-19 06:50:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-19 06:50:18 +0000 |
commit | 6b187e445897ef301708cd962f630e982bc60224 (patch) | |
tree | 856f2f3801d3dee16cca5ef77765d401994a6dfe /vendor/golang.org/x/sys/windows | |
parent | 959d6a0c40b60a84eead551eaaa7498450017763 (diff) | |
download | podman-6b187e445897ef301708cd962f630e982bc60224.tar.gz podman-6b187e445897ef301708cd962f630e982bc60224.tar.bz2 podman-6b187e445897ef301708cd962f630e982bc60224.zip |
Bump github.com/vbauerster/mpb/v6 from 6.0.3 to 6.0.4
Bumps [github.com/vbauerster/mpb/v6](https://github.com/vbauerster/mpb) from 6.0.3 to 6.0.4.
- [Release notes](https://github.com/vbauerster/mpb/releases)
- [Commits](https://github.com/vbauerster/mpb/compare/v6.0.3...v6.0.4)
Signed-off-by: dependabot[bot] <support@github.com>
Diffstat (limited to 'vendor/golang.org/x/sys/windows')
-rw-r--r-- | vendor/golang.org/x/sys/windows/empty.s | 1 | ||||
-rw-r--r-- | vendor/golang.org/x/sys/windows/exec_windows.go | 34 |
2 files changed, 35 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/windows/empty.s b/vendor/golang.org/x/sys/windows/empty.s index 69309e4da..fdbbbcd31 100644 --- a/vendor/golang.org/x/sys/windows/empty.s +++ b/vendor/golang.org/x/sys/windows/empty.s @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !go1.12 // +build !go1.12 // This file is here to allow bodyless functions with go:linkname for Go 1.11 diff --git a/vendor/golang.org/x/sys/windows/exec_windows.go b/vendor/golang.org/x/sys/windows/exec_windows.go index 9eb1fb633..a020caeef 100644 --- a/vendor/golang.org/x/sys/windows/exec_windows.go +++ b/vendor/golang.org/x/sys/windows/exec_windows.go @@ -78,6 +78,40 @@ func EscapeArg(s string) string { return string(qs[:j]) } +// ComposeCommandLine escapes and joins the given arguments suitable for use as a Windows command line, +// in CreateProcess's CommandLine argument, CreateService/ChangeServiceConfig's BinaryPathName argument, +// or any program that uses CommandLineToArgv. +func ComposeCommandLine(args []string) string { + var commandLine string + for i := range args { + if i > 0 { + commandLine += " " + } + commandLine += EscapeArg(args[i]) + } + return commandLine +} + +// DecomposeCommandLine breaks apart its argument command line into unescaped parts using CommandLineToArgv, +// as gathered from GetCommandLine, QUERY_SERVICE_CONFIG's BinaryPathName argument, or elsewhere that +// command lines are passed around. +func DecomposeCommandLine(commandLine string) ([]string, error) { + if len(commandLine) == 0 { + return []string{}, nil + } + var argc int32 + argv, err := CommandLineToArgv(StringToUTF16Ptr(commandLine), &argc) + if err != nil { + return nil, err + } + defer LocalFree(Handle(unsafe.Pointer(argv))) + var args []string + for _, v := range (*argv)[:argc] { + args = append(args, UTF16ToString((*v)[:])) + } + return args, nil +} + func CloseOnExec(fd Handle) { SetHandleInformation(Handle(fd), HANDLE_FLAG_INHERIT, 0) } |