re PR fortran/26554 ([gfortran] incorrect behaviour when reading a logical variable...
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Sun, 5 Mar 2006 17:54:07 +0000 (17:54 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Sun, 5 Mar 2006 17:54:07 +0000 (17:54 +0000)
2006-03-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libgfortran/26554
* io/list_read.c (read_logical): Return the value if not in namelist
mode.

From-SVN: r111738

libgfortran/ChangeLog
libgfortran/io/list_read.c

index ff9e599edc55991efd68b0f38c71a0909aa23aa4..5bfe9c36e103b4e3f5f32a39f749d9ba60638f0b 100644 (file)
@@ -1,3 +1,9 @@
+2006-03-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/26554
+       * io/list_read.c (read_logical): Return the value if not in namelist
+       mode.
+
 2006-03-03  Thomas Koenig  <Thomas.Koenig@online.de>
 
        PR fortran/25031
index 5ff4cbbc299d2be4d6d7c9acbdb41777cbf076b0..ab9b25d2ba48030c901b909e3dc1e4180bba70ef 100644 (file)
@@ -647,18 +647,17 @@ read_logical (st_parameter_dt *dtp, int length)
       c = next_char (dtp);
       if (is_separator(c))
        {
+         /* All done if this is not a namelist read.  */
+         if (!dtp->u.p.namelist_mode)
+           goto logical_done;
+
          unget_char (dtp, c);
          eat_separator (dtp);
          c = next_char (dtp);
          if (c != '=')
            {
              unget_char (dtp, c);
-             dtp->u.p.item_count = 0;
-             dtp->u.p.line_buffer_enabled = 0;
-             dtp->u.p.saved_type = BT_LOGICAL;
-             dtp->u.p.saved_length = length;
-             set_integer ((int *) dtp->u.p.value, v, length);
-             return;
+             goto logical_done;
            }
        }
  
@@ -670,7 +669,8 @@ read_logical (st_parameter_dt *dtp, int length)
          dtp->u.p.item_count = 0;
          return;
        }
-     }
+      
+    }
 
  bad_logical:
 
@@ -681,6 +681,15 @@ read_logical (st_parameter_dt *dtp, int length)
              dtp->u.p.item_count);
 
   generate_error (&dtp->common, ERROR_READ_VALUE, message);
+  return;
+
+ logical_done:
+  
+  dtp->u.p.item_count = 0;
+  dtp->u.p.line_buffer_enabled = 0;
+  dtp->u.p.saved_type = BT_LOGICAL;
+  dtp->u.p.saved_length = length;
+  set_integer ((int *) dtp->u.p.value, v, length);
 }