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
fix sccsid to use keywords and modern initialization syntax
[unix-history]
/
usr
/
src
/
usr.bin
/
window
/
wwgets.c
diff --git
a/usr/src/usr.bin/window/wwgets.c
b/usr/src/usr.bin/window/wwgets.c
index
d7ada1a
..
0a5c086
100644
(file)
--- a/
usr/src/usr.bin/window/wwgets.c
+++ b/
usr/src/usr.bin/window/wwgets.c
@@
-1,8
+1,15
@@
#ifndef lint
#ifndef lint
-static char
*sccsid = "@(#)wwgets.c 3.3 84/01/16
";
+static char
sccsid[] = "@(#)wwgets.c 3.9 %G%
";
#endif
#endif
+/*
+ * Copyright (c) 1983 Regents of the University of California,
+ * All rights reserved. Redistribution permitted subject to
+ * the terms of the Berkeley Software License Agreement.
+ */
+
#include "ww.h"
#include "ww.h"
+#include "char.h"
wwgets(buf, n, w)
char *buf;
wwgets(buf, n, w)
char *buf;
@@
-11,7
+18,9
@@
register struct ww *w;
{
register char *p = buf;
register char c;
{
register char *p = buf;
register char c;
+ char uc = w->ww_unctrl;
+ w->ww_unctrl = 0;
for (;;) {
wwcurtowin(w);
while ((c = wwgetc()) < 0)
for (;;) {
wwcurtowin(w);
while ((c = wwgetc()) < 0)
@@
-19,8
+28,6
@@
register struct ww *w;
if (c == wwoldtty.ww_sgttyb.sg_erase) {
if (p > buf)
rub(*--p, w);
if (c == wwoldtty.ww_sgttyb.sg_erase) {
if (p > buf)
rub(*--p, w);
- else
- wwbell();
} else if (c == wwoldtty.ww_sgttyb.sg_kill) {
while (p > buf)
rub(*--p, w);
} else if (c == wwoldtty.ww_sgttyb.sg_kill) {
while (p > buf)
rub(*--p, w);
@@
-34,12
+41,13
@@
register struct ww *w;
break;
} else {
if (p >= buf + n - 1)
break;
} else {
if (p >= buf + n - 1)
- ww
bell(
);
+ ww
putc(ctrl(g), w
);
else
else
-
(void)
wwputs(unctrl(*p++ = c), w);
+ wwputs(unctrl(*p++ = c), w);
}
}
*p = 0;
}
}
*p = 0;
+ w->ww_unctrl = uc;
}
static
}
static
@@
-49,5
+57,5
@@
struct ww *w;
register i;
for (i = strlen(unctrl(c)); --i >= 0;)
register i;
for (i = strlen(unctrl(c)); --i >= 0;)
- (void) ww
puts("\b \b", w
);
+ (void) ww
write(w, "\b \b", 3
);
}
}