values so that comparisons are correct
tty: fix an out of bounds error in tty_status_update() for BL_HUNGER case
tty: fix leftover display artifact when last field on the row got smaller
+ and optimize so only the right-most field requires the cleanup code
X11: its use of genl_status_update exposed a negative index use that could
lead to a segfault
#endif
E char *NDECL(tty_get_color_string);
#endif
+E void FDECL(tty_status_enablefield,
+ (int, const char *, const char *, BOOLEAN_P));
E void NDECL(tty_status_init);
E void FDECL(tty_status_update, (int, genericptr_t, int, int, int, unsigned long *));
#endif
tty_getmsghistory, tty_putmsghistory,
tty_status_init,
- genl_status_finish, genl_status_enablefield,
+ genl_status_finish, tty_status_enablefield,
#ifdef STATUS_HILITES
tty_status_update,
#else
genl_status_init();
}
+void
+tty_status_enablefield(fieldidx, nm, fmt, enable)
+int fieldidx;
+const char *nm;
+const char *fmt;
+boolean enable;
+{
+ genl_status_enablefield(fieldidx, nm, fmt, enable);
+ /* force re-evaluation of last field on the row */
+ setlast = FALSE;
+}
+
void
do_setlast()
{
setlast = TRUE;
for (row = 0; row < 2; ++row)
- for (i = MAX_PER_ROW - 1; i ; --i) {
+ for (i = MAX_PER_ROW - 1; i > 0; --i) {
fld = fieldorder[row][i];
if (fld == BL_FLUSH || !status_activefields[fld])