From 8f387d13ff1bbd45391878c0b3324898d55721f1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 31 Aug 2003 21:09:27 +0000 Subject: [PATCH] don't return \n from GetLineText() neither git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/textctrl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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); } -- 2.50.0