From 68493a5a20aaaf9652b1fd00b9c7a0722379c964 Mon Sep 17 00:00:00 2001 From: olsner Date: Mon, 1 Dec 2003 12:14:21 +0000 Subject: [PATCH] Oh My God! I broke it! - But it should be fixed now This was SVN commit r133. --- source/ps/CStr.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/ps/CStr.cpp b/source/ps/CStr.cpp index 907e6dcf8d..b542ffcd87 100755 --- a/source/ps/CStr.cpp +++ b/source/ps/CStr.cpp @@ -234,7 +234,8 @@ CStr CStr::Trim(PS_TRIM_MODE Mode) case PS_TRIM_RIGHT: { - for (Right = m_String.length()-1; Right >= 0; Right--) + Right = m_String.length(); + while (Right--) if (_istspace(m_String[Right]) == false) break; // end found, trim len-1 to Right+1 inclusive } break; @@ -245,7 +246,8 @@ CStr CStr::Trim(PS_TRIM_MODE Mode) if (_istspace(m_String[Left]) == false) break; // end found, trim 0 to Left-1 inclusive - for (Right = m_String.length()-1; Right >= 0; Right--) + Right = m_String.length(); + while (Right--) if (_istspace(m_String[Right]) == false) break; // end found, trim len-1 to Right+1 inclusive } break;