diff --git a/projects/mtg/src/SimplePad.cpp b/projects/mtg/src/SimplePad.cpp index 590a997d1..c8d74d07f 100644 --- a/projects/mtg/src/SimplePad.cpp +++ b/projects/mtg/src/SimplePad.cpp @@ -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;