diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-09-16 15:05:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-16 15:05:28 -0400 |
commit | 2a30b60666001b7039aaf5318ffeaa0374433f27 (patch) | |
tree | 421afa18f2bdb6c03d2be3872b6135efdf8282da /vendor/github.com/Azure/go-ansiterm | |
parent | fcb22e82b518bd8de31bc152b78d2cbc6ab09964 (diff) | |
parent | 29edeaa892df2f533f997adb0736f09a6f8e0965 (diff) | |
download | podman-2a30b60666001b7039aaf5318ffeaa0374433f27.tar.gz podman-2a30b60666001b7039aaf5318ffeaa0374433f27.tar.bz2 podman-2a30b60666001b7039aaf5318ffeaa0374433f27.zip |
Merge pull request #11598 from mheon/34_backportsreleasenotes
Backports and release notes for v3.4.0-RC1
Diffstat (limited to 'vendor/github.com/Azure/go-ansiterm')
-rw-r--r-- | vendor/github.com/Azure/go-ansiterm/go.mod | 5 | ||||
-rw-r--r-- | vendor/github.com/Azure/go-ansiterm/go.sum | 2 | ||||
-rw-r--r-- | vendor/github.com/Azure/go-ansiterm/winterm/ansi.go | 24 |
3 files changed, 26 insertions, 5 deletions
diff --git a/vendor/github.com/Azure/go-ansiterm/go.mod b/vendor/github.com/Azure/go-ansiterm/go.mod new file mode 100644 index 000000000..965cb8120 --- /dev/null +++ b/vendor/github.com/Azure/go-ansiterm/go.mod @@ -0,0 +1,5 @@ +module github.com/Azure/go-ansiterm + +go 1.16 + +require golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 diff --git a/vendor/github.com/Azure/go-ansiterm/go.sum b/vendor/github.com/Azure/go-ansiterm/go.sum new file mode 100644 index 000000000..9f05d9d3e --- /dev/null +++ b/vendor/github.com/Azure/go-ansiterm/go.sum @@ -0,0 +1,2 @@ +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go b/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go index a67327972..5599082ae 100644 --- a/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go +++ b/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go @@ -10,6 +10,7 @@ import ( "syscall" "github.com/Azure/go-ansiterm" + windows "golang.org/x/sys/windows" ) // Windows keyboard constants @@ -162,15 +163,28 @@ func ensureInRange(n int16, min int16, max int16) int16 { func GetStdFile(nFile int) (*os.File, uintptr) { var file *os.File - switch nFile { - case syscall.STD_INPUT_HANDLE: + + // syscall uses negative numbers + // windows package uses very big uint32 + // Keep these switches split so we don't have to convert ints too much. + switch uint32(nFile) { + case windows.STD_INPUT_HANDLE: file = os.Stdin - case syscall.STD_OUTPUT_HANDLE: + case windows.STD_OUTPUT_HANDLE: file = os.Stdout - case syscall.STD_ERROR_HANDLE: + case windows.STD_ERROR_HANDLE: file = os.Stderr default: - panic(fmt.Errorf("Invalid standard handle identifier: %v", nFile)) + switch nFile { + case syscall.STD_INPUT_HANDLE: + file = os.Stdin + case syscall.STD_OUTPUT_HANDLE: + file = os.Stdout + case syscall.STD_ERROR_HANDLE: + file = os.Stderr + default: + panic(fmt.Errorf("Invalid standard handle identifier: %v", nFile)) + } } fd, err := syscall.GetStdHandle(nFile) |