diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d5da496e14bf..6dca973645aa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-06-20 Tobias Burnus + + PR fortran/57633 + * gfortran.dg/list_read_11.f90: New. + 2013-06-20 Richard Biener PR tree-optimization/57584 @@ -23,13 +28,13 @@ 2013-06-19 Balaji V. Iyer - * c-c++-common/cilk-plus/AN/builtin_fn_custom.c: Replaced all the - hard-coded values of array sizes with a #define. - * c-c++-common/cilk-plus/AN/builtin_fn_mutating.c: Likewise. - * c-c++-common/cilk-plus/AN/builtin_func_double2.c: Likewise. - * c-c++-common/cilk-plus/AN/gather_scatter.c: Likewise. - * c-c++-common/cilk-plus/AN/pr57577.c: Likewise. - * c-c++-common/cilk-plus/AN/sec_implicit_ex.c: Likewise. + * c-c++-common/cilk-plus/AN/builtin_fn_custom.c: Replaced all the + hard-coded values of array sizes with a #define. + * c-c++-common/cilk-plus/AN/builtin_fn_mutating.c: Likewise. + * c-c++-common/cilk-plus/AN/builtin_func_double2.c: Likewise. + * c-c++-common/cilk-plus/AN/gather_scatter.c: Likewise. + * c-c++-common/cilk-plus/AN/pr57577.c: Likewise. + * c-c++-common/cilk-plus/AN/sec_implicit_ex.c: Likewise. 2013-06-19 Yufeng Zhang diff --git a/gcc/testsuite/gfortran.dg/list_read_11.f90 b/gcc/testsuite/gfortran.dg/list_read_11.f90 new file mode 100644 index 000000000000..10344a1959eb --- /dev/null +++ b/gcc/testsuite/gfortran.dg/list_read_11.f90 @@ -0,0 +1,38 @@ +! { dg-do run } +! { dg-options "-fbackslash" } +! +! PR fortran/57633 +! +program teststuff + implicit none + integer::a + character(len=10)::s1,s2 + + open(11,file="testcase.txt",form='unformatted',access='stream',status='new') + write(11) 'line1,1,\r\nline2' + close(11) + + open(11,file="testcase.txt",form='formatted') + s1 = repeat('x', len(s1)) + a = 99 + read(11,*)s1,a + if (s1 /= "line1" .or. a /= 1) call abort() + + s1 = repeat('x', len(s1)) + read(11,"(a)")s1 + close(11,status="delete") + if (s1 /= "line2") call abort() + + + open(11,file="testcase.txt",form='unformatted',access='stream',status='new') + write(11) 'word1\rword2,\n' + close(11) + + open(11,file="testcase.txt",form='formatted') + s1 = repeat('x', len(s1)) + s2 = repeat('x', len(s1)) + read(11,*)s1,s2 + close(11,status="delete") + if (s1 /= "word1") call abort() + if (s2 /= "word2") call abort() +end program teststuff diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index d5ffcd2f03e3..40f98d205998 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2013-06-20 Tobias Burnus + + PR fortran/57633 + * io/list_read.c (next_char, eat_separator): Don't set EOL for \r. + 2012-06-19 Uros Bizjak * config/fpu-387.h: Use __asm__ and __volatile__ consistently. diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index c8a1bdfc9d9e..82a98a56e979 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -242,7 +242,7 @@ next_char (st_parameter_dt *dtp) dtp->u.p.current_unit->strm_pos++; } done: - dtp->u.p.at_eol = (c == '\n' || c == '\r' || c == EOF); + dtp->u.p.at_eol = (c == '\n' || c == EOF); return c; } @@ -334,7 +334,6 @@ eat_separator (st_parameter_dt *dtp) break; case '\r': - dtp->u.p.at_eol = 1; if ((n = next_char(dtp)) == EOF) return LIBERROR_END; if (n != '\n')