diff options
author | Raimo Niskanen <raimo@erlang.org> | 2011-07-21 15:36:45 +0200 |
---|---|---|
committer | Raimo Niskanen <raimo@erlang.org> | 2011-07-21 15:36:45 +0200 |
commit | f5b1153ea4eb536c44999debc7a9d7707a1e070b (patch) | |
tree | 64a5f56fba8b3ea1236857d736484174fd9ed915 /lib/stdlib/src/io_lib_fread.erl | |
parent | fd09fd9f41824fb56fd4d31c2fa18b3f4168e4e9 (diff) | |
download | otp-f5b1153ea4eb536c44999debc7a9d7707a1e070b.tar.gz otp-f5b1153ea4eb536c44999debc7a9d7707a1e070b.tar.bz2 otp-f5b1153ea4eb536c44999debc7a9d7707a1e070b.zip |
EOF before first field is only ok for first character in io:fread
Diffstat (limited to 'lib/stdlib/src/io_lib_fread.erl')
-rw-r--r-- | lib/stdlib/src/io_lib_fread.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/stdlib/src/io_lib_fread.erl b/lib/stdlib/src/io_lib_fread.erl index 137759bbab..411d293876 100644 --- a/lib/stdlib/src/io_lib_fread.erl +++ b/lib/stdlib/src/io_lib_fread.erl @@ -123,8 +123,8 @@ fread([_F|_Format], [_C|_Line], _N, _Results) -> fread_error(input); fread([_|_]=Format, [], N, Results) -> {more,Format,N,Results}; -fread([_|_], eof, _N, []) -> - %% This is at start of format string so no error. +fread([_|_], eof, 0, []) -> + %% This is at start of input so no error. eof; fread([_|_], eof, _N, _Results) -> %% This is an error as there is no more input. @@ -175,8 +175,8 @@ fread1([$l|Format], _F, Sup, _U, Line, N, Res, _AllFormat) -> fread1(_Format, _F, _Sup, _U, [], N, Res, AllFormat) -> %% Need more input here. {more,[$~|AllFormat],N,Res}; -fread1(_Format, _F, _Sup, _U, eof, _N, [], _AllFormat) -> - %% This is at start of format string so no error. +fread1(_Format, _F, _Sup, _U, eof, 0, [], _AllFormat) -> + %% This is at start of input so no error. eof; fread1(_Format, _F, _Sup, _U, eof, _N, _Res, _AllFormat) -> %% This is an error as there is no more input. |