summaryrefslogtreecommitdiff
path: root/libgfortran/io
diff options
context:
space:
mode:
authorjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-13 18:46:44 +0000
committerjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-13 18:46:44 +0000
commitfbf88933e1572db3dc78fa751c7d00a331a73cd2 (patch)
treee79f00855ec05f85b621ccd763a2676cc70806e1 /libgfortran/io
parent867bec2cad33fe69ce54da65855f19bc7f88789a (diff)
downloadgcc-fbf88933e1572db3dc78fa751c7d00a331a73cd2.tar.gz
PR 49296 List read, EOF without preceding separator
2011-07-13 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/49296 * io/list_read.c (read_logical): Don't error out if a valid value is followed by EOF instead of a normal separator. (read_integer): Likewise. testsuite: 2011-07-13 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/49296 * gfortran.dg/read_list_eof_1.f90: Add tests for integer, real, and logical reads. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176245 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io')
-rw-r--r--libgfortran/io/list_read.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index baf2f54041a..c88f23293a3 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -657,22 +657,20 @@ read_logical (st_parameter_dt *dtp, int length)
{
case 't':
v = 1;
- if ((c = next_char (dtp)) == EOF)
- goto bad_logical;
+ c = next_char (dtp);
l_push_char (dtp, c);
- if (!is_separator(c))
+ if (!is_separator(c) && c != EOF)
goto possible_name;
unget_char (dtp, c);
break;
case 'f':
v = 0;
- if ((c = next_char (dtp)) == EOF)
- goto bad_logical;
+ c = next_char (dtp);
l_push_char (dtp, c);
- if (!is_separator(c))
+ if (!is_separator(c) && c != EOF)
goto possible_name;
unget_char (dtp, c);
@@ -837,6 +835,7 @@ read_integer (st_parameter_dt *dtp, int length)
goto repeat;
CASE_SEPARATORS: /* Not a repeat count. */
+ case EOF:
goto done;
default:
@@ -886,6 +885,7 @@ read_integer (st_parameter_dt *dtp, int length)
break;
CASE_SEPARATORS:
+ case EOF:
goto done;
default: