From 40787e3814f5dcfa4955c1c674f4b00439685e7e Mon Sep 17 00:00:00 2001 From: "brade%netscape.com" Date: Fri, 18 Jul 2003 14:09:34 +0000 Subject: [PATCH] fix bug found when reading source, replace ending space to match intent and version 1; r=jfrancis, sr=blizzard, bug=209548 --- editor/libeditor/text/nsAOLCiter.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/editor/libeditor/text/nsAOLCiter.cpp b/editor/libeditor/text/nsAOLCiter.cpp index 428274a5cb8..28c868632c4 100644 --- a/editor/libeditor/text/nsAOLCiter.cpp +++ b/editor/libeditor/text/nsAOLCiter.cpp @@ -66,14 +66,11 @@ nsAOLCiter::GetCiteString(const nsAString& aInString, nsAString& aOutString) PRUnichar newline ('\n'); if (aOutString.Last() == newline) { - aOutString.Append(PRUnichar(' ')); - aOutString.Append(NS_LITERAL_STRING("<<\n")); - } - else - { - aOutString.Append(NS_LITERAL_STRING(" <<\n")); + aOutString.SetLength(aOutString.Length() - 1); } + aOutString.Append(NS_LITERAL_STRING(" <<\n")); + return NS_OK; } @@ -82,7 +79,7 @@ nsAOLCiter::StripCites(const nsAString& aInString, nsAString& aOutString) { // Remove the beginning cites, if any: nsAutoString tOutputString; - nsReadingIterator iter,enditer; + nsReadingIterator iter, enditer; aInString.BeginReading(iter); aInString.EndReading(enditer); if (StringBeginsWith(aInString, NS_LITERAL_STRING(">>"))) @@ -90,10 +87,10 @@ nsAOLCiter::StripCites(const nsAString& aInString, nsAString& aOutString) iter.advance(2); while (nsCRT::IsAsciiSpace(*iter)) ++iter; - AppendUnicodeTo(iter,enditer,tOutputString); + AppendUnicodeTo(iter, enditer, tOutputString); } else - CopyUnicodeTo(iter,enditer,tOutputString); + CopyUnicodeTo(iter, enditer, tOutputString); // Remove the end cites, if any: tOutputString.Trim("<", PR_FALSE, PR_TRUE, PR_FALSE);