summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/PythonUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Slice/PythonUtil.cpp')
-rw-r--r--cpp/src/Slice/PythonUtil.cpp9
1 files changed, 9 insertions, 0 deletions
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);