converted man page
[unix-history] / usr / src / old / as.vax / asscan2.c
index cc254d6..ae470fc 100644 (file)
@@ -1,8 +1,11 @@
 /*
 /*
- *     Copyright (c) 1982 Regents of the University of California
+ * Copyright (c) 1982 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
  */
  */
+
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)asscan2.c 4.13 %G%";
+static char sccsid[] = "@(#)asscan2.c  5.1 (Berkeley) %G%";
 #endif not lint
 
 #include "asscanl.h"
 #endif not lint
 
 #include "asscanl.h"
@@ -13,26 +16,28 @@ char        inbufunget[8];
 char   inbuffer[ASINBUFSIZ];
 char   *Ginbufptr = inbuffer;
 int    Ginbufcnt = 0;
 char   inbuffer[ASINBUFSIZ];
 char   *Ginbufptr = inbuffer;
 int    Ginbufcnt = 0;
+int    scannerhadeof;
 
 fillinbuffer()
 {
                int     nread;
 
 fillinbuffer()
 {
                int     nread;
-       static  int     hadeof;
                int     goal;
                int     got;
 
        nread = 0;
                int     goal;
                int     got;
 
        nread = 0;
-       if (hadeof == 0){
+       if (scannerhadeof == 0){
                goal = sizeof(inbuffer);
                do {
                        got = read(stdin->_file, inbuffer + nread, goal);
                        if (got == 0)
                goal = sizeof(inbuffer);
                do {
                        got = read(stdin->_file, inbuffer + nread, goal);
                        if (got == 0)
-                               hadeof = 1;
+                               scannerhadeof = 1;
                        if (got <= 0)
                                break;
                        nread += got;
                        goal -= got;
                } while (goal);
                        if (got <= 0)
                                break;
                        nread += got;
                        goal -= got;
                } while (goal);
+       } else {
+               scannerhadeof = 0;
        }
        /*
         *      getchar assumes that Ginbufcnt and Ginbufptr
        }
        /*
         *      getchar assumes that Ginbufcnt and Ginbufptr