diff --git a/src/uifc/uifc.h b/src/uifc/uifc.h index 7de1b6b8de9192a5184fa23079daf0c4de1e52be..2b045337253f7d1c9e95e46974aa90f3a9de06a9 100644 --- a/src/uifc/uifc.h +++ b/src/uifc/uifc.h @@ -201,6 +201,7 @@ typedef int64_t uifc_winmode_t; #define K_FIND (1 << 17) /* Don't set the "changes" flag */ #define K_TRIM (1 << 23) /* Don't allow leading or trailing wsp */ #define K_NOSPACE (1 << 26) /* Don't allow any wsp chars */ +#define K_CHANGED (1 << 28) /* Return -1 if string was not changed (w/K_EDIT) */ /* Extra exit flags */ diff --git a/src/uifc/uifc32.c b/src/uifc/uifc32.c index 2d2709c9e746c5e40196976f2abd79663e66a4d3..9c6bdfac7a4c96513f79356c76060507712fdc0d 100644 --- a/src/uifc/uifc32.c +++ b/src/uifc/uifc32.c @@ -2541,6 +2541,8 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int { if (!(mode & K_FIND) && strcmp(outstr, str)) api->changes = 1; + else if (mode & K_CHANGED) + j = -1; } else {