aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2006-03-05 17:54:07 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2006-03-05 17:54:07 +0000
commit03e957f8c8c0d3691454521e7daa9c2287f48b19 (patch)
tree01d97e69c38c0120fd7e67528eb7fbe7d0e171c7
parent0bf8477d987a278a0cfe8040b6117d2f08469202 (diff)
downloadgcc-03e957f8c8c0d3691454521e7daa9c2287f48b19.zip
gcc-03e957f8c8c0d3691454521e7daa9c2287f48b19.tar.gz
gcc-03e957f8c8c0d3691454521e7daa9c2287f48b19.tar.bz2
re PR fortran/26554 ([gfortran] incorrect behaviour when reading a logical variable from a string)
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
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/io/list_read.c23
2 files changed, 22 insertions, 7 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index ff9e599..5bfe9c3 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -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
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index 5ff4cbb..ab9b25d 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -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);
}