diff options
author | Raimo Niskanen <raimo@erlang.org> | 2011-07-21 12:28:13 +0200 |
---|---|---|
committer | Raimo Niskanen <raimo@erlang.org> | 2011-07-21 12:28:13 +0200 |
commit | fd09fd9f41824fb56fd4d31c2fa18b3f4168e4e9 (patch) | |
tree | b213e163e38de4120e561b5e11d85a9667453298 /lib/stdlib/src/io_lib_fread.erl | |
parent | a3d8134ffcb4ec7be60bdc896fb9be0928c2b1ff (diff) | |
download | otp-fd09fd9f41824fb56fd4d31c2fa18b3f4168e4e9.tar.gz otp-fd09fd9f41824fb56fd4d31c2fa18b3f4168e4e9.tar.bz2 otp-fd09fd9f41824fb56fd4d31c2fa18b3f4168e4e9.zip |
At end of input ask for more also for for literal format characters
Diffstat (limited to 'lib/stdlib/src/io_lib_fread.erl')
-rw-r--r-- | lib/stdlib/src/io_lib_fread.erl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/stdlib/src/io_lib_fread.erl b/lib/stdlib/src/io_lib_fread.erl index 52aa4d073c..137759bbab 100644 --- a/lib/stdlib/src/io_lib_fread.erl +++ b/lib/stdlib/src/io_lib_fread.erl @@ -121,6 +121,14 @@ fread([C|Format], [C|Line], N, Results) -> fread(Format, Line, N+1, Results); 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. + eof; +fread([_|_], eof, _N, _Results) -> + %% This is an error as there is no more input. + fread_error(input); fread([], Line, _N, Results) -> {ok,reverse(Results),Line}. |