aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/troff
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-12-14 21:31:06 +0000
committerrsc <devnull@localhost>2005-12-14 21:31:06 +0000
commitb2f08f618b3d5fcd1a6f816fa73bd7d77d888180 (patch)
tree5e63af8a6908d8062f6cc30d62f8683dc1ea29e1 /src/cmd/troff
parent989e6dc3ac24d1ab3ee7a1d66c5f5e5a1a37bb2d (diff)
downloadplan9port-b2f08f618b3d5fcd1a6f816fa73bd7d77d888180.tar.gz
plan9port-b2f08f618b3d5fcd1a6f816fa73bd7d77d888180.tar.bz2
plan9port-b2f08f618b3d5fcd1a6f816fa73bd7d77d888180.zip
don't need this after all. yay.
Diffstat (limited to 'src/cmd/troff')
-rw-r--r--src/cmd/troff/fns.h1
-rw-r--r--src/cmd/troff/n5.c23
-rw-r--r--src/cmd/troff/ni.c1
3 files changed, 6 insertions, 19 deletions
diff --git a/src/cmd/troff/fns.h b/src/cmd/troff/fns.h
index d04fd037..922a3a80 100644
--- a/src/cmd/troff/fns.h
+++ b/src/cmd/troff/fns.h
@@ -172,7 +172,6 @@ void casefl(void);
void caseev(void);
void envcopy(Env *e1, Env *e2);
void caseel(void);
-void caseei(void);
void caseie(void);
void casexif(void);
void caseif(void);
diff --git a/src/cmd/troff/n5.c b/src/cmd/troff/n5.c
index 72f9bbb6..2c7d3287 100644
--- a/src/cmd/troff/n5.c
+++ b/src/cmd/troff/n5.c
@@ -8,7 +8,7 @@
#include "fns.h"
#include "ext.h"
-int iflist[NIF]; /* whether 'else' is true */
+int iflist[NIF];
int ifx;
int ifnum = 0; /* trying numeric expression for .if or .ie condition */
@@ -612,16 +612,6 @@ void envcopy(Env *e1, Env *e2) /* copy env e2 to e1 */
}
-void caseei(void)
-{
- if (--ifx < 0) {
- ifx = 0;
- iflist[0] = 0;
- }
- caseif1(1);
- ifx++;
-}
-
void caseel(void)
{
if (--ifx < 0) {
@@ -631,6 +621,7 @@ void caseel(void)
caseif1(2);
}
+
void caseie(void)
{
if (ifx >= NIF) {
@@ -638,11 +629,11 @@ void caseie(void)
ifx = 0;
edone(040);
}
- iflist[ifx] = 1;
caseif1(1);
ifx++;
}
+
void caseif(void)
{
caseif1(0);
@@ -654,7 +645,7 @@ void caseif1(int x)
int notflag, true;
Tchar i;
- if (x == 2) { /* .el */
+ if (x == 2) {
notflag = 0;
true = iflist[ifx];
goto i1;
@@ -700,10 +691,8 @@ void caseif1(int x)
}
i1:
true ^= notflag;
- if (x == 1) { /* .ie or .ei */
- true = true && iflist[ifx];
- iflist[ifx] = iflist[ifx] && !true;
- }
+ if (x == 1)
+ iflist[ifx] = !true;
if (true) {
i2:
while ((cbits(i = getch())) == ' ')
diff --git a/src/cmd/troff/ni.c b/src/cmd/troff/ni.c
index 27a0ff3d..a80cec64 100644
--- a/src/cmd/troff/ni.c
+++ b/src/cmd/troff/ni.c
@@ -70,7 +70,6 @@ Contab contab[NM] = {
C(PAIR('n', 'r'), casenr),
C(PAIR('i', 'f'), caseif),
C(PAIR('i', 'e'), caseie),
- C(PAIR('e', 'i'), caseei),
C(PAIR('e', 'l'), caseel),
C(PAIR('p', 'o'), casepo),
C(PAIR('t', 'l'), casetl),