- if (WEXITSTATUS(wstat))
- warn("%s exited with code %d", promptprog, WEXITSTATUS(status));
-
+ if (WEXITSTATUS(wstat)) {
+ warn("%s exited with code %d", promptprog, WEXITSTATUS(wstat));
+ /* code when cancel was hit in the prompt prog */
+ if (WEXITSTATUS(wstat) == 128) {
+ promptprog_refused = 1;
+ }
+ return -1;
+ }