Mercurial > octave
diff libinterp/corefcn/oct-stream.cc @ 30790:5fbc41f7a8d1
textscan: Reposition scan pointer after reading a single `.` (bug #60711).
* oct-stream.cc (textscan::read_double):
When a single `.` is encountered, it is indeed considered an invalid character.
But it must also be put back because, unlike any other invalid character, it
has caused an additional `get()` call above.
This then allows the various tests for the presence of a delimiter on the next
character to fail (e.g., in `textscan::read_format_once()` and
`textscan_format_list::read_first_row()`), and thus finally allows `textscan()`
builtin to exit correctly in error.
* file-io.cc (Ftextscan): Add BIST.
* doc/interpreter/contributors.in: Add new contributor to list in manual.
author | Gaël Bonithon <gael@xfce.org> |
---|---|
date | Mon, 28 Feb 2022 11:48:29 +0100 |
parents | 76398dfe2d55 |
children | 0826c503f294 |
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stream.cc Mon Feb 28 08:36:29 2022 +0100 +++ b/libinterp/corefcn/oct-stream.cc Mon Feb 28 11:48:29 2022 +0100 @@ -2851,6 +2851,11 @@ if (i > 0) valid = true; // valid if at least one digit after '.' + else if (! valid) // if there was nothing before and after '.' + { + is.putback (ch); + ch = '.'; + } // skip remainder after '.', to field width, to look for exponent if (i == precision)