Jeck - Fix to issue 181, SimplePad now strips all trailing whitespace before returning results.

This commit is contained in:
wagic.jeck
2009-11-23 06:20:21 +00:00
parent f4f11f9018
commit e364b17117

View File

@@ -290,7 +290,15 @@ string SimplePad::Finish() {
if(bCanceled){
dest = NULL;
return original;
}else{ //Strip trailing spaces.
string whitespaces (" \t\f\v\n\r");
size_t found=buffer.find_last_not_of(whitespaces);
if (found!=string::npos)
buffer.erase(found+1);
else
buffer = "";
}
if(dest != NULL){
dest->clear(); dest->insert(0,buffer);
dest = NULL;