+
+/*
+ * set_ch:
+ * Set the first and last change flags for this window.
+ */
+static
+set_ch(win, y, x, ch, orig)
+reg WINDOW *win;
+int y, x;
+WINDOW *orig; {
+
+ if (orig != NULL) {
+ y -= win->_begy - orig->_begy;
+ x -= win->_begx - orig->_begx;
+ }
+ if (y < 0 || y >= win->_maxy || x < 0 || x >= win->_maxx)
+ return;
+ if (win->_y[y][x] != ch) {
+ if (win->_firstch[y] == _NOCHANGE)
+ win->_firstch[y] = win->_lastch[y] = x;
+ else if (x < win->_firstch[y])
+ win->_firstch[y] = x;
+ else if (x > win->_lastch[y])
+ win->_lastch[y] = x;
+ }
+}