summaryrefslogtreecommitdiff
path: root/bgetceofindeed.c
blob: bc79162ea9307d8a0bfcfdf906acc96fc11e0452 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <u.h>
#include <libc.h>
#include <bio.h>

void
main()
{
	Biobuf *bin;
	char c;

	bin = Bfdopen(0, OREAD);
	if(bin == nil)
		sysfatal("Bfdopen: %r");
	while((c = Bgetc(bin)) != Beof)
		;
	USED(c);
	c = Bgetc(bin);
	if(c == Beof)
		print("eof indeed\n");
	else
		print("no eof after eof\n");
	exits(0);
}