From 9fbc512142e5cfd2780fc4dfb1ad42d31ff7df7f Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Tue, 2 May 2017 14:03:22 -0400 Subject: Removed trailing whitespace from generated Python code --- cpp/src/Slice/PythonUtil.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cpp/src/Slice/PythonUtil.cpp') diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp index ae3c04aa9b9..5cafcb8603e 100644 --- a/cpp/src/Slice/PythonUtil.cpp +++ b/cpp/src/Slice/PythonUtil.cpp @@ -2301,6 +2301,15 @@ Slice::Python::CodeVisitor::stripMarkup(const string& comment) start = text.size(); } + // + // Remove trailing whitespace + // + pos = line.find_last_not_of(" \t"); + if(pos != string::npos) + { + line.erase(pos + 1, line.size() - pos - 1); + } + lines.push_back(line); start = text.find_first_not_of("\r\n", start); -- cgit v1.2.3