summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Parser.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-10-09 21:28:37 +0000
committerMarc Laukien <marc@zeroc.com>2001-10-09 21:28:37 +0000
commit7655900645f361d7a6811e21a5a12425de0e82f4 (patch)
tree12375e45c54b8fc3712f87dc242396f75f75468e /cpp/src/Slice/Parser.cpp
parentBasicStream; Stream.ice (diff)
downloadice-7655900645f361d7a6811e21a5a12425de0e82f4.tar.bz2
ice-7655900645f361d7a6811e21a5a12425de0e82f4.tar.xz
ice-7655900645f361d7a6811e21a5a12425de0e82f4.zip
Stream.ice; docbook fixes
Diffstat (limited to 'cpp/src/Slice/Parser.cpp')
-rw-r--r--cpp/src/Slice/Parser.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp
index b1c1d2401b7..bfeeb2d2134 100644
--- a/cpp/src/Slice/Parser.cpp
+++ b/cpp/src/Slice/Parser.cpp
@@ -1871,7 +1871,25 @@ Slice::Unit::setComment(const string& comment)
}
end = comment.find('\n', begin);
- _currentComment += comment.substr(begin, end - begin + 1);
+ if (end != string::npos)
+ {
+ if (end + 1 > begin)
+ {
+ _currentComment += comment.substr(begin, end + 1 - begin);
+ }
+ }
+ else
+ {
+ end = comment.find_last_not_of(" \t\r\n*");
+ if (end != string::npos)
+ {
+ if (end + 1 > begin)
+ {
+ _currentComment += comment.substr(begin, end + 1 - begin);
+ }
+ }
+ break;
+ }
}
}