Skip to content
Snippets Groups Projects
Commit ee965f21 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add K_CHANGED mode flag for uifc.input()

Used in combination with K_EDIT, if the string isn't actually changed, return
-1 (same as abort/ESC).

This allows the elimination of some save/compare/copy code in SCFG where we
only care to even look at the string if it was changed from its existing
value.
parent 4197220b
Branches
Tags
No related merge requests found
......@@ -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 */
......
......@@ -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
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment