]> diplodocus.org Git - nmh/commitdiff
Restored local variable to m_Eom(), to not truncate EOF.
authorDavid Levine <levinedl@acm.org>
Sat, 29 Jul 2017 21:55:25 +0000 (17:55 -0400)
committerDavid Levine <levinedl@acm.org>
Sat, 29 Jul 2017 21:55:25 +0000 (17:55 -0400)
Reversion of significant part of commit d3e11c5e9.  Thanks to Ralph
for noticing that it wasn't a good change.

sbr/m_getfld.c

index 683db17..f7a7acb 100644 (file)
@@ -876,10 +876,13 @@ m_Eom (m_getfld_state_t s)
     char *cp;
 
     for (i = 0, cp = text; i < s->edelimlen; ++i, ++cp) {
-       if ((*cp = Getc (s)) == EOF) {
+       int c2;
+
+       if ((c2 = Getc (s)) == EOF) {
            *cp = '\0';
            break;
        }
+        *cp = c2;
     }
 
     if (i != s->edelimlen  ||