OSDN Git Service

2006-02-21 Erik Edelmann <eedelman@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / libgfortran / io / list_read.c
index b11f6a5..793f0e2 100644 (file)
@@ -164,7 +164,7 @@ next_char (st_parameter_dt *dtp)
             check for NULL here is cautionary. */
          if (p == NULL)
            {
-             generate_error (&dtp->common, ERROR_OS, NULL);
+             generate_error (&dtp->common, ERROR_INTERNAL_UNIT, NULL);
              return '\0';
            }
 
@@ -1353,7 +1353,16 @@ list_formatted_read_scalar (st_parameter_dt *dtp, bt type, void *p, int kind,
        {                       /* Found a null value.  */
          eat_separator (dtp);
          dtp->u.p.repeat_count = 0;
-         goto cleanup;
+
+         /* eat_separator sets this flag if the separator was a comma */
+         if (dtp->u.p.comma_flag)
+           goto cleanup;
+
+         /* eat_separator sets this flag if the separator was a \n or \r */
+         if (dtp->u.p.at_eol)
+           finish_separator (dtp);
+         else
+           goto cleanup;
        }
 
     }