summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/PythonUtil.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2017-05-02 14:03:22 -0400
committerBernard Normier <bernard@zeroc.com>2017-05-02 14:03:22 -0400
commit9fbc512142e5cfd2780fc4dfb1ad42d31ff7df7f (patch)
tree251e844e26253716871afe6401f88e92b9a0a4c7 /cpp/src/Slice/PythonUtil.cpp
parentRemoved tabs and trailing whitespace from .l and .y files (diff)
downloadice-9fbc512142e5cfd2780fc4dfb1ad42d31ff7df7f.tar.bz2
ice-9fbc512142e5cfd2780fc4dfb1ad42d31ff7df7f.tar.xz
ice-9fbc512142e5cfd2780fc4dfb1ad42d31ff7df7f.zip
Removed trailing whitespace from generated Python code
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);