Skip to content

Commit

Permalink
Fix #11.
Browse files Browse the repository at this point in the history
  • Loading branch information
ncruces committed May 22, 2021
1 parent 6e3393b commit 6033f51
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion util_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package zenity

import (
"bytes"
"os/exec"
"strconv"
"strings"
Expand Down Expand Up @@ -55,8 +56,9 @@ func appendIcon(args []string, opts options) []string {
}

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 opts.extraButton != nil && *opts.extraButton+"\n" == string(out) {
if opts.extraButton != nil && *opts.extraButton == string(out) {
return "", ErrExtraButton
}
return "", ErrCanceled
Expand Down

0 comments on commit 6033f51

Please sign in to comment.