Skip to content

Commit a58f955

Browse files
committed
wunput() should reset_text()
1 parent 4826e61 commit a58f955

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

include/reflex/absmatcher.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,7 @@ class AbstractMatcher {
10511051
void wunput(int c) ///< character to put back
10521052
{
10531053
DBGLOG("AbstractMatcher::wunput()");
1054+
reset_text();
10541055
char tmp[8];
10551056
size_t n = utf8(c, tmp);
10561057
if (pos_ >= n)
@@ -1059,6 +1060,8 @@ class AbstractMatcher {
10591060
}
10601061
else if (own_)
10611062
{
1063+
n -= pos_;
1064+
pos_ = 0;
10621065
txt_ = buf_;
10631066
len_ = 0;
10641067
if (end_ + n >= max_)

0 commit comments

Comments
 (0)