mirror of git://gcc.gnu.org/git/gcc.git
re PR libfortran/19678 (DOS files don't work for list directed input)
PR libfortran/19678
PR libfortran/19679
* gfortran.dg/dos_eol.f: New test.
PR libfortran/19678
* list_read.c (next_char, eat_separator, finish_separator, read_real)
(namelist_read): Add support for '\r' as well as '\n' as EOL
character.
PR libfortran/19679
* list_read.c (read_sf): Add a '\r' in a test to support DOS
line-endings when line length is exceeded.
From-SVN: r97041
This commit is contained in:
parent
cd92865225
commit
94887ef478
|
|
@ -1,3 +1,9 @@
|
||||||
|
2005-03-25 Francois-Xavier Coudert <coudert@clipper.ens.fr>
|
||||||
|
|
||||||
|
PR libfortran/19678
|
||||||
|
PR libfortran/19679
|
||||||
|
* gfortran.dg/dos_eol.f: New test.
|
||||||
|
|
||||||
2005-03-25 Zdenek Dvorak <dvorakz@suse.cz>
|
2005-03-25 Zdenek Dvorak <dvorakz@suse.cz>
|
||||||
|
|
||||||
PR rtl-optimization/20249
|
PR rtl-optimization/20249
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
! PR libfortran/19678 and PR libfortran/19679
|
||||||
|
! { dg-do run }
|
||||||
|
integer i, j
|
||||||
|
|
||||||
|
open (10,status='scratch')
|
||||||
|
write (10,'(2A)') '1', achar(13)
|
||||||
|
rewind (10)
|
||||||
|
read (10,*) i
|
||||||
|
if (i .ne. 1) call abort
|
||||||
|
close (10)
|
||||||
|
|
||||||
|
open (10,status='scratch')
|
||||||
|
write (10,'(2A)') ' 1', achar(13)
|
||||||
|
write (10,'(2A)') ' 2', achar(13)
|
||||||
|
rewind (10)
|
||||||
|
read (10,'(I4)') i
|
||||||
|
read (10,'(I5)') j
|
||||||
|
if ((i .ne. 1) .or. (j .ne. 2)) call abort
|
||||||
|
end
|
||||||
|
|
@ -1,3 +1,14 @@
|
||||||
|
2005-03-25 Francois-Xavier Coudert <coudert@clipper.ens.fr>
|
||||||
|
|
||||||
|
PR libfortran/19678
|
||||||
|
* list_read.c (next_char, eat_separator, finish_separator, read_real)
|
||||||
|
(namelist_read): Add support for '\r' as well as '\n' as EOL
|
||||||
|
character.
|
||||||
|
|
||||||
|
PR libfortran/19679
|
||||||
|
* list_read.c (read_sf): Add a '\r' in a test to support DOS
|
||||||
|
line-endings when line length is exceeded.
|
||||||
|
|
||||||
2005-03-25 Francois-Xavier Coudert <coudert@clipper.ens.fr>
|
2005-03-25 Francois-Xavier Coudert <coudert@clipper.ens.fr>
|
||||||
|
|
||||||
PR libfortran/15332
|
PR libfortran/15332
|
||||||
|
|
|
||||||
|
|
@ -66,12 +66,13 @@ static char value[20];
|
||||||
#define CASE_DIGITS case '0': case '1': case '2': case '3': case '4': \
|
#define CASE_DIGITS case '0': case '1': case '2': case '3': case '4': \
|
||||||
case '5': case '6': case '7': case '8': case '9'
|
case '5': case '6': case '7': case '8': case '9'
|
||||||
|
|
||||||
#define CASE_SEPARATORS case ' ': case ',': case '/': case '\n': case '\t'
|
#define CASE_SEPARATORS case ' ': case ',': case '/': case '\n': case '\t': \
|
||||||
|
case '\r'
|
||||||
|
|
||||||
/* This macro assumes that we're operating on a variable. */
|
/* This macro assumes that we're operating on a variable. */
|
||||||
|
|
||||||
#define is_separator(c) (c == '/' || c == ',' || c == '\n' || c == ' ' \
|
#define is_separator(c) (c == '/' || c == ',' || c == '\n' || c == ' ' \
|
||||||
|| c == '\t')
|
|| c == '\t' || c == '\r')
|
||||||
|
|
||||||
/* Maximum repeat count. Less than ten times the maximum signed int32. */
|
/* Maximum repeat count. Less than ten times the maximum signed int32. */
|
||||||
|
|
||||||
|
|
@ -163,7 +164,7 @@ next_char (void)
|
||||||
c = *p;
|
c = *p;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
at_eol = (c == '\n');
|
at_eol = (c == '\n' || c == '\r');
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -230,6 +231,7 @@ eat_separator (void)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '\n':
|
case '\n':
|
||||||
|
case '\r':
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '!':
|
case '!':
|
||||||
|
|
@ -284,6 +286,7 @@ finish_separator (void)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '\n':
|
case '\n':
|
||||||
|
case '\r':
|
||||||
goto restart;
|
goto restart;
|
||||||
|
|
||||||
case '!':
|
case '!':
|
||||||
|
|
@ -1052,6 +1055,8 @@ read_real (int length)
|
||||||
goto got_repeat;
|
goto got_repeat;
|
||||||
|
|
||||||
CASE_SEPARATORS:
|
CASE_SEPARATORS:
|
||||||
|
if (c != '\n' && c != ',' && c != '\r')
|
||||||
|
unget_char (c);
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
@ -1483,6 +1488,7 @@ namelist_read (void)
|
||||||
return;
|
return;
|
||||||
case ' ':
|
case ' ':
|
||||||
case '\n':
|
case '\n':
|
||||||
|
case '\r':
|
||||||
case '\t':
|
case '\t':
|
||||||
break;
|
break;
|
||||||
case ',':
|
case ',':
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ read_sf (int *length)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (readlen < 1 || *q == '\n')
|
if (readlen < 1 || *q == '\n' || *q == '\r')
|
||||||
{
|
{
|
||||||
/* ??? What is this for? */
|
/* ??? What is this for? */
|
||||||
if (current_unit->unit_number == options.stdin_unit)
|
if (current_unit->unit_number == options.stdin_unit)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue