[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #62152] Textscan fails in rare occurences
From: |
Markus Mützel |
Subject: |
[Octave-bug-tracker] [bug #62152] Textscan fails in rare occurences |
Date: |
Tue, 8 Mar 2022 05:37:15 -0500 (EST) |
Update of bug #62152 (project octave):
Status: None => Confirmed
Operating System: Microsoft Windows => Any
_______________________________________________________
Follow-up Comment #1:
Thanks for your report.
No solution yet. But I believe the issue is that `delimited_stream::peek ()`
doesn't work as expected if peeking beyond what is currently in the buffer
`delimited_stream::m_buf`:
https://hg.savannah.gnu.org/hgweb/octave/file/0826c503f294/libinterp/corefcn/oct-stream.cc#l1267
int peek (void)
{ return eof () ? std::istream::traits_type::eof () : *m_idx; }
The part of the code where I think this might be an issue is around here:
https://hg.savannah.gnu.org/hgweb/octave/file/0826c503f294/libinterp/corefcn/oct-stream.cc#l2868
// look for exponent part in, e.g., 6.023E+23
bool used_exp = false;
if (valid && width_left > 1 && m_exp_chars.find (ch) !=
std::string::npos)
{
int ch1 = is.peek ();
Maybe we could use `peek_undelim` here? Or somehow fix `delimited_stream::peek
()` when at the end of the buffer?
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62152>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/