summaryrefslogtreecommitdiff
path: root/sys/src/cmd/sed.c
diff options
context:
space:
mode:
authoraiju <aiju@phicode.de>2011-07-13 14:17:09 +0200
committeraiju <aiju@phicode.de>2011-07-13 14:17:09 +0200
commitdb0f050d2b65a5fe329cf9454720420cb2deb721 (patch)
treea018a55765531186d6a5c8eab00f41722d921e97 /sys/src/cmd/sed.c
parentebe8f9460b6a3012c9c75d8479a3e427d5c04977 (diff)
fixed error handling in p, pr, sed, xd, yacc
Diffstat (limited to 'sys/src/cmd/sed.c')
-rw-r--r--sys/src/cmd/sed.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/src/cmd/sed.c b/sys/src/cmd/sed.c
index 4fd08b8b5..aa603b4bd 100644
--- a/sys/src/cmd/sed.c
+++ b/sys/src/cmd/sed.c
@@ -207,6 +207,7 @@ main(int argc, char **argv)
lnum = 0;
Binit(&fout, 1, OWRITE);
+ Blethal(&fout, nil);
fcode[nfiles++] = &fout;
compfl = 0;
@@ -610,6 +611,7 @@ open_file(char *name)
(fd = create(name, OWRITE, 0666)) < 0)
quit("Cannot create %s", name);
Binit(bp, fd, OWRITE);
+ Blethal(bp, nil);
Bseek(bp, 0, 2);
fcode[nfiles++] = bp;
return bp;
@@ -688,6 +690,7 @@ newfile(enum PTYPE type, char *name)
prog.curr = name;
else if ((prog.bp = Bopen(name, OREAD)) == 0)
quit("Cannot open pattern-file: %s\n", name);
+ Blethal(prog.bp, nil);
prog.type = type;
}
@@ -1347,6 +1350,7 @@ arout(void)
*s = '\0';
if((fi = Bopen(buf, OREAD)) == 0)
continue;
+ Blethal(fi, nil);
while((c = Bgetc(fi)) >= 0)
Bputc(&fout, c);
Bterm(fi);
@@ -1450,6 +1454,7 @@ opendata(void)
Binit(&stdin, 0, OREAD);
f = &stdin;
}
+ Blethal(f, nil);
fhead = fhead->next;
return 1;
}