]> diplodocus.org Git - nmh/commitdiff
Restored an explicit refill of the buffer in m_getfld() that I
authorDavid Levine <levinedl@acm.org>
Wed, 26 Dec 2012 15:52:12 +0000 (09:52 -0600)
committerDavid Levine <levinedl@acm.org>
Wed, 26 Dec 2012 15:52:12 +0000 (09:52 -0600)
removed in the big stdio cleanup.  Its need is shown by reducing
the message buffer size to 2048.

sbr/m_getfld.c

index b02acd588961064a62bf25af2ca6c972044e6564..27e3d3bc668437766d2fa94bef2975860ca0a4b2 100644 (file)
@@ -359,8 +359,8 @@ m_getfld (int state, unsigned char name[NAMESZ], unsigned char *buf,
 
                j = bp - sp;
                if ((cnt -= j) <= 0) {
 
                j = bp - sp;
                if ((cnt -= j) <= 0) {
-                   /* Used to explicitly force refill of the buffer
-                      here, but Getc() will do that if necessary. */
+                   /* Next to force refill of the buffer here. */
+                   m.readpos = m.end;
                    if (Getc (iob) == EOF) {
                        *cp = *buf = 0;
                        advise (NULL, "eof encountered in field \"%s\"", name);
                    if (Getc (iob) == EOF) {
                        *cp = *buf = 0;
                        advise (NULL, "eof encountered in field \"%s\"", name);