The 'ahead' mechanism was not right
authorceriel <none@none>
Mon, 9 Nov 1987 11:45:39 +0000 (11:45 +0000)
committerceriel <none@none>
Mon, 9 Nov 1987 11:45:39 +0000 (11:45 +0000)
modules/src/read_em/read_em.c

index ec7f916..e7cd58d 100644 (file)
@@ -217,7 +217,11 @@ EM_getinstr(p)
 
        EM_error = 0;
        if (ahead) {
-               *p = aheads[--ahead];
+               register int i;
+
+               ahead--;
+               *p = aheads[0];
+               for (i = 0; i < ahead; i++) aheads[i] = aheads[i+1];
                return 1;
        }
        emhead = p;