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
modify semantics of FOR to reflect shadowing of for loop vars in longs
[unix-history]
/
usr
/
src
/
usr.bin
/
ex
/
ex_vmain.c
diff --git
a/usr/src/usr.bin/ex/ex_vmain.c
b/usr/src/usr.bin/ex/ex_vmain.c
index
81beaae
..
b26df64
100644
(file)
--- a/
usr/src/usr.bin/ex/ex_vmain.c
+++ b/
usr/src/usr.bin/ex/ex_vmain.c
@@
-1,5
+1,5
@@
-/* Copyright (c) 198
0
Regents of the University of California */
-static char *sccsid = "@(#)ex_vmain.c
5.3
%G%";
+/* Copyright (c) 198
1
Regents of the University of California */
+static char *sccsid = "@(#)ex_vmain.c
7.1
%G%";
#include "ex.h"
#include "ex_tty.h"
#include "ex_vis.h"
#include "ex.h"
#include "ex_tty.h"
#include "ex_vis.h"
@@
-61,6
+61,7
@@
vmain()
vglobp = 0;
vreg = 0;
hold = 0;
vglobp = 0;
vreg = 0;
hold = 0;
+ seenprompt = 1;
wcursor = 0;
Xhadcnt = hadcnt = 0;
Xcnt = cnt = 1;
wcursor = 0;
Xhadcnt = hadcnt = 0;
Xcnt = cnt = 1;
@@
-146,8
+147,10
@@
reread:
ungetkey(c);
goto looptop;
}
ungetkey(c);
goto looptop;
}
- if (!value(REMAP))
+ if (!value(REMAP)) {
+ c = op;
break;
break;
+ }
if (++maphopcnt > 256)
error("Infinite macro loop");
} while (c != op);
if (++maphopcnt > 256)
error("Infinite macro loop");
} while (c != op);
@@
-306,6
+309,10
@@
reread:
* ^D Scroll down. Like scroll up.
*/
case CTRL(d):
* ^D Scroll down. Like scroll up.
*/
case CTRL(d):
+#ifdef TRACE
+ if (trace)
+ fprintf(trace, "before vdown in ^D, dot=%d, wdot=%d, dol=%d\n", lineno(dot), lineno(wdot), lineno(dol));
+#endif
if (hadcnt)
vSCROLL = cnt;
cnt = vSCROLL;
if (hadcnt)
vSCROLL = cnt;
cnt = vSCROLL;
@@
-315,7
+322,15
@@
reread:
ind = 0;
vmoving = 0;
vdown(cnt, ind, 1);
ind = 0;
vmoving = 0;
vdown(cnt, ind, 1);
+#ifdef TRACE
+ if (trace)
+ fprintf(trace, "before vnline in ^D, dot=%d, wdot=%d, dol=%d\n", lineno(dot), lineno(wdot), lineno(dol));
+#endif
vnline(NOSTR);
vnline(NOSTR);
+#ifdef TRACE
+ if (trace)
+ fprintf(trace, "after vnline in ^D, dot=%d, wdot=%d, dol=%d\n", lineno(dot), lineno(wdot), lineno(dol));
+#endif
continue;
/*
continue;
/*
@@
-389,7
+404,9
@@
reread:
case CTRL(f):
vsave();
if (vcnt > 2) {
case CTRL(f):
vsave();
if (vcnt > 2) {
- dot += (vcnt - vcline) - 2 + (cnt-1)*basWLINES;
+ addr = dot + (vcnt - vcline) - 2 + (cnt-1)*basWLINES;
+ forbid(addr > dol);
+ dot = addr;
vcnt = vcline = 0;
}
vzop(0, 0, '+');
vcnt = vcline = 0;
}
vzop(0, 0, '+');
@@
-402,7
+419,9
@@
reread:
case CTRL(b):
vsave();
if (one + vcline != dot && vcnt > 2) {
case CTRL(b):
vsave();
if (one + vcline != dot && vcnt > 2) {
- dot -= vcline - 2 + (cnt-1)*basWLINES;
+ addr = dot - vcline - 2 + (cnt-1)*basWLINES;
+ forbid (addr <= zero);
+ dot = addr;
vcnt = vcline = 0;
}
vzop(0, 0, '^');
vcnt = vcline = 0;
}
vzop(0, 0, '^');
@@
-490,8
+509,8
@@
reread:
*/
case 'O':
case 'o':
*/
case 'O':
case 'o':
- voOpen(c, cnt);
vmacchng(1);
vmacchng(1);
+ voOpen(c, cnt);
continue;
/*
continue;
/*
@@
-852,7
+871,8
@@
gogo:
#ifdef SIGTSTP
/*
* ^Z: suspend editor session and temporarily return
#ifdef SIGTSTP
/*
* ^Z: suspend editor session and temporarily return
- * to shell. Only works on Berkeley tty driver.
+ * to shell. Only works with Berkeley/IIASA process
+ * control in kernel.
*/
case CTRL(z):
forbid(dosusp == 0 || !ldisc);
*/
case CTRL(z):
forbid(dosusp == 0 || !ldisc);