diff options
author | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-24 19:26:02 +0000 |
---|---|---|
committer | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-24 19:26:02 +0000 |
commit | 3eddec55745eb2be95eb463aca2c83a60538b83a (patch) | |
tree | af89e009992f855776a49c47ce4bd0fb173a37a0 /libgfortran | |
parent | a21c148a80a9ecc7d34f61bbb5647fd3969ff164 (diff) | |
download | gcc-3eddec55745eb2be95eb463aca2c83a60538b83a.tar.gz |
2014-05-23 Jerry DeLisle <jvdelisle@gcc.gnu>
PR libfortran/61173
* io/list_read.c (eat_spaces): If the next character pointed to
is a space, don't seek, must be at the end.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210898 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 6 | ||||
-rw-r--r-- | libgfortran/io/list_read.c | 18 |
2 files changed, 17 insertions, 7 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 42177735644..cead92d2ed8 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2014-05-23 Jerry DeLisle <jvdelisle@gcc.gnu> + + PR libfortran/61173 + * io/list_read.c (eat_spaces): If the next character pointed to + is a space, don't seek, must be at the end. + 2014-05-23 Hans-Peter Nilsson <hp@axis.com> * configure.ac [with_newlib] (HAVE_STRNLEN, HAVE_STRNDUP): Define. diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index 885db4a399a..5ccd0220ac1 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -398,7 +398,7 @@ eat_spaces (st_parameter_dt *dtp) if (is_array_io (dtp)) { gfc_offset offset = stell (dtp->u.p.current_unit->s); - gfc_offset limit = dtp->u.p.current_unit->bytes_left; + gfc_offset limit = offset + dtp->u.p.current_unit->bytes_left; if (dtp->common.unit) /* kind=4 */ { @@ -410,13 +410,15 @@ eat_spaces (st_parameter_dt *dtp) offset += (sizeof (gfc_char4_t)); dtp->u.p.current_unit->bytes_left--; } - while (offset < limit && (cc == (gfc_char4_t)' ' - || cc == (gfc_char4_t)'\t')); + while (offset < limit && cc == (gfc_char4_t)' '); /* Back up, seek ahead, and fall through to complete the process so that END conditions are handled correctly. */ dtp->u.p.current_unit->bytes_left++; - sseek (dtp->u.p.current_unit->s, - offset-(sizeof (gfc_char4_t)), SEEK_SET); + + cc = dtp->internal_unit[offset]; + if (cc != (gfc_char4_t)' ') + sseek (dtp->u.p.current_unit->s, + offset-(sizeof (gfc_char4_t)), SEEK_SET); } else { @@ -425,11 +427,13 @@ eat_spaces (st_parameter_dt *dtp) c = dtp->internal_unit[offset++]; dtp->u.p.current_unit->bytes_left--; } - while (offset < limit && (c == ' ' || c == '\t')); + while (offset < limit && c == ' '); /* Back up, seek ahead, and fall through to complete the process so that END conditions are handled correctly. */ dtp->u.p.current_unit->bytes_left++; - sseek (dtp->u.p.current_unit->s, offset-1, SEEK_SET); + + if (dtp->internal_unit[offset] != ' ') + sseek (dtp->u.p.current_unit->s, offset - 1, SEEK_SET); } } /* Now skip spaces, EOF and EOL are handled in next_char. */ |