diff options
author | Michi Henning <michi@zeroc.com> | 2005-03-24 03:08:04 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2005-03-24 03:08:04 +0000 |
commit | 9a1a8fcce630340295dbc65134adba9be5163dc0 (patch) | |
tree | eb31bfe823d5592908309c79a6fe6d2e958a2609 /cpp/src/Slice/Parser.cpp | |
parent | Slice definitions at global scope (other than module definitions) are now a (diff) | |
download | ice-9a1a8fcce630340295dbc65134adba9be5163dc0.tar.bz2 ice-9a1a8fcce630340295dbc65134adba9be5163dc0.tar.xz ice-9a1a8fcce630340295dbc65134adba9be5163dc0.zip |
Fixed http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=188
Diffstat (limited to 'cpp/src/Slice/Parser.cpp')
-rw-r--r-- | cpp/src/Slice/Parser.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index fee71a14368..d9cfc8ba2e2 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -4576,15 +4576,21 @@ Slice::Unit::nextLine() void Slice::Unit::scanPosition(const char* s) { - string line(s); - string::size_type idx; + assert(*s == '#'); - idx = line.find("line"); - if(idx != string::npos) + const char* p = s + 1; // Skip leading # + while(isspace(*p)) + { + ++p; + } + if(strncmp(p, "line", 4) == 0) { - line.erase(0, idx + 4); + p += 4; } + string line(p); + string::size_type idx; + idx = line.find_first_not_of(" \t\r#"); if(idx != string::npos) { |