do case insensitive comparison on domain name
[unix-history] / usr / src / usr.bin / window / wwredrawwin.c
index ade3ba2..e8ef26f 100644 (file)
@@ -1,36 +1,54 @@
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwredrawwin.c       3.1 83/08/12";
-#endif
+static char sccsid[] = "@(#)wwredrawwin.c      3.14 (Berkeley) %G%";
+#endif /* not lint */
 
 #include "ww.h"
 
 
 #include "ww.h"
 
-wwredrawwin(w)
-register struct ww *w;
-{
-       wwredrawwin1(w, 0, w->ww_w.nr - 1, w->ww_scroll);
-}
-
-wwredrawwin1(w, srow, erow, offset)
+wwredrawwin1(w, row1, row2, offset)
 register struct ww *w;
 register struct ww *w;
-int srow, erow, offset;
+int row1, row2, offset;
 {
 {
-       int i;
-       register j;
+       int row;
+       register col;
        register char *smap;
        register union ww_char *buf;
        register char *win;
        register union ww_char *ns;
        register char *smap;
        register union ww_char *buf;
        register char *win;
        register union ww_char *ns;
+       int x;
+       int nchanged;
 
 
-       for (i = srow; i <= erow; i++) {
-               ns = &wwns[i + w->ww_w.t][w->ww_w.l];
-               smap = &wwsmap[i + w->ww_w.t][w->ww_w.l];
-               buf = w->ww_buf[offset + i];
-               win = w->ww_win[i];
-               for (j = w->ww_w.nc; --j >= 0;)
-                       if (*smap++ != w->ww_index)
-                               win++, ns++, buf++;
-                       else
-                               ns++->c_w = buf++->c_w
-                                       ^ *win++ << WWC_MSHIFT;
+       for (row = row1; row < row2; row++) {
+               col = w->ww_i.l;
+               ns = wwns[row];
+               smap = &wwsmap[row][col];
+               buf = w->ww_buf[row + offset];
+               win = w->ww_win[row];
+               nchanged = 0;
+               for (; col < w->ww_i.r; col++)
+                       if (*smap++ == w->ww_index &&
+                           ns[col].c_w !=
+                           (x = buf[col].c_w ^ win[col] << WWC_MSHIFT)) {
+                               nchanged++;
+                               ns[col].c_w = x;
+                       }
+               if (nchanged > 0)
+                       wwtouched[row] |= WWU_TOUCHED;
        }
 }
        }
 }