No empty .Rs/.Re
[netbsd-mini2440.git] / share / man / tools / pages.c
blob725a2d81bbaa6525456bae1f5d7b18032e1821ac
1 /* $NetBSD$ */
3 #include <stdio.h>
5 #define T_INIT 0100
6 #define T_STOP 0111
8 long charin; /* number of input character */
10 main(argc, argv)
11 char **argv;
14 int npages = 0;
15 register int c;
17 while((c=getchar()) != EOF) {
18 charin++;
19 c &= 0377;
20 if(c != T_INIT)
21 continue;
22 else {
23 c=getchar();
24 c &= 0377;
25 if(c == T_STOP) {
26 npages++;
27 charin++;
31 if(charin<5) {
32 fprintf(stderr, "%s: no input\n", argv[0]);
33 exit(1);
35 printf("%d\n", npages);