From: Vadim Zeitlin Date: Sun, 31 Aug 2003 21:09:27 +0000 (+0000) Subject: don't return \n from GetLineText() neither X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8f387d13ff1bbd45391878c0b3324898d55721f1 don't return \n from GetLineText() neither git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index fda9d0207d..a00d54dcd6 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -1291,6 +1291,13 @@ wxString wxTextCtrl::GetLineText(long lineNo) const } #endif // wxUSE_RICHEDIT + // remove the '\n' at the end, if any (this is how this function is + // supposed to work according to the docs) + if ( buf[len - 1] == _T('\n') ) + { + len--; + } + buf[len] = 0; tmp.SetLength(len); }