Fix #14.
This commit is contained in:
parent
6e3393bd4f
commit
598ce272cb
1 changed files with 3 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
||||||
package zenity
|
package zenity
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -55,8 +56,9 @@ func appendIcon(args []string, opts options) []string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func strResult(opts options, out []byte, err error) (string, error) {
|
func strResult(opts options, out []byte, err error) (string, error) {
|
||||||
|
out = bytes.TrimSuffix(out, []byte{'\n'})
|
||||||
if err, ok := err.(*exec.ExitError); ok && err.ExitCode() == 1 {
|
if err, ok := err.(*exec.ExitError); ok && err.ExitCode() == 1 {
|
||||||
if opts.extraButton != nil && *opts.extraButton+"\n" == string(out) {
|
if opts.extraButton != nil && *opts.extraButton == string(out) {
|
||||||
return "", ErrExtraButton
|
return "", ErrExtraButton
|
||||||
}
|
}
|
||||||
return "", ErrCanceled
|
return "", ErrCanceled
|
||||||
|
|
Loading…
Reference in a new issue