From: Lars Gullik Bjønnes Date: Wed, 10 Jan 2001 09:49:20 +0000 (+0000) Subject: fix rfind bug X-Git-Tag: 1.6.10~21740 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=1c2ba9dd5c0a651b267618c2a44cb589fca9a173;p=lyx.git fix rfind bug git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1310 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/ChangeLog b/ChangeLog index 584bba6fa7..062a642304 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-01-10 Lars Gullik Bjønnes + + * src/support/lyxstring.C (rfind): also test the first char in the + string and be sure that t >= 0. + 2001-01-09 Lars Gullik Bjønnes * src/tabular.C (ReadNew): new method diff --git a/src/support/lyxstring.C b/src/support/lyxstring.C index e3fd5d3e60..967fd88650 100644 --- a/src/support/lyxstring.C +++ b/src/support/lyxstring.C @@ -1028,7 +1028,7 @@ lyxstring::size_type lyxstring::rfind(value_type c, size_type i) const TestlyxstringInvariant(this); size_type ii = min(rep->sz - 1, i); - for (size_type t = ii; t != 0; --t) { + for (size_type t = ii; t >= 0; --t) { if (rep->s[t] == c) return t; } return npos;