From 1c2ba9dd5c0a651b267618c2a44cb589fca9a173 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Wed, 10 Jan 2001 09:49:20 +0000 Subject: [PATCH] fix rfind bug git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1310 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 5 +++++ src/support/lyxstring.C | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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; -- 2.39.5