projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
.Xr botch fix
[unix-history]
/
usr
/
src
/
usr.bin
/
window
/
wwlabel.c
diff --git
a/usr/src/usr.bin/window/wwlabel.c
b/usr/src/usr.bin/window/wwlabel.c
index
edbf234
..
2a90ee6
100644
(file)
--- a/
usr/src/usr.bin/window/wwlabel.c
+++ b/
usr/src/usr.bin/window/wwlabel.c
@@
-1,8
+1,19
@@
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Edward Wang at The University of California, Berkeley.
+ *
+ * %sccs.include.redist.c%
+ */
+
#ifndef lint
#ifndef lint
-static char
*sccsid = "@(#)wwlabel.c 3.6 83/08/26
";
-#endif
+static char
sccsid[] = "@(#)wwlabel.c 3.17 (Berkeley) %G%
";
+#endif
/* not lint */
#include "ww.h"
#include "ww.h"
+#include "char.h"
/*
* Label window w on f,
/*
* Label window w on f,
@@
-14,54
+25,46
@@
struct ww *w;
struct ww *f;
char *l;
{
struct ww *f;
char *l;
{
- int
i
;
+ int
row
;
register j;
register j;
-
register char *p
;
+
int jj
;
register char *win;
register union ww_char *buf;
register union ww_char *ns;
register char *fmap;
register char *win;
register union ww_char *buf;
register union ww_char *ns;
register char *fmap;
- char *touched;
+ register char *smap;
+ char touched;
+ char *p;
if (f->ww_fmap == 0)
return;
if (f->ww_fmap == 0)
return;
-
i = w->ww_w.t - 1 - f->ww_w.t
;
- if (
i < 0
)
+
row = w->ww_w.t - 1
;
+ if (
row < f->ww_i.t || row >= f->ww_i.b
)
return;
return;
- j = w->ww_w.l + where - f->ww_w.l;
- if (j < 0)
- j = 0;
- win = &f->ww_win[i][j];
- buf = &f->ww_buf[f->ww_scroll + i][j];
- fmap = &f->ww_fmap[i][j];
-
- i += f->ww_w.t;
- j += f->ww_w.l;
- ns = &wwns[i][j];
- touched = &wwtouched[i];
+ win = f->ww_win[row];
+ buf = f->ww_buf[row];
+ fmap = f->ww_fmap[row];
+ ns = wwns[row];
+ smap = wwsmap[row];
+ touched = wwtouched[row];
+ mode <<= WWC_MSHIFT;
- j = MIN(w->ww_w.r, f->ww_w.r) - j;
- for (; j > 0 && *l;)
- for (p = unctrl(*l++); j > 0 && *p; j--) {
+ jj = MIN(w->ww_i.r, f->ww_i.r);
+ j = w->ww_i.l + where;
+ while (j < jj && *l)
+ for (p = unctrl(*l++); j < jj && *p; j++, p++) {
/* can't label if not already framed */
/* can't label if not already framed */
- if (*win & WWM_GLS) {
- p++;
- buf++;
- ns++;
- win++;
- fmap++;
- } else if (*win & WWM_COV) {
- buf++->c_w = mode << WWC_MSHIFT | *p++;
- *fmap++ |= WWF_LABEL;
- ns++;
- win++;
- } else {
- *touched = 1;
- ns++->c_w = (buf++->c_w
- = mode << WWC_MSHIFT | *p++)
- ^ *win++ << WWC_MSHIFT;
- *fmap++ |= WWF_LABEL;
+ if (win[j] & WWM_GLS)
+ continue;
+ if (smap[j] != f->ww_index)
+ buf[j].c_w = mode | *p;
+ else {
+ ns[j].c_w = (buf[j].c_w = mode | *p)
+ ^ win[j] << WWC_MSHIFT;
+ touched |= WWU_TOUCHED;
}
}
+ fmap[j] |= WWF_LABEL;
}
}
+ wwtouched[row] = touched;
}
}