diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-06-29 13:27:47 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-06-29 13:27:47 +0000 |
commit | dd16e69e475bb11722d2a8a4df969ae9954940bb (patch) | |
tree | e9a7dd3baaacd7c49ae737b49c9fab3c49c04fad /cpp/src/IceGrid/FileUserAccountMapperI.cpp | |
parent | Bug 1152. (diff) | |
download | ice-dd16e69e475bb11722d2a8a4df969ae9954940bb.tar.bz2 ice-dd16e69e475bb11722d2a8a4df969ae9954940bb.tar.xz ice-dd16e69e475bb11722d2a8a4df969ae9954940bb.zip |
Simplified file format
Diffstat (limited to 'cpp/src/IceGrid/FileUserAccountMapperI.cpp')
-rw-r--r-- | cpp/src/IceGrid/FileUserAccountMapperI.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/cpp/src/IceGrid/FileUserAccountMapperI.cpp b/cpp/src/IceGrid/FileUserAccountMapperI.cpp index 77c44297642..eb93538e6ed 100644 --- a/cpp/src/IceGrid/FileUserAccountMapperI.cpp +++ b/cpp/src/IceGrid/FileUserAccountMapperI.cpp @@ -51,15 +51,20 @@ FileUserAccountMapperI::FileUserAccountMapperI(const string& filename) continue; } - string::size_type end = line.find_last_of(delim); + string::size_type end = line.find_first_of(delim, beg); if(end == string::npos || end <= beg) { continue; - } - - string user = line.substr(beg, end - beg); - string account = line.substr(end + 1); + } + string account = line.substr(beg, end - beg); + beg = line.find_first_not_of(delim, end); + if(beg == string::npos) + { + continue; + } + string user = line.substr(beg); + assert(!user.empty()); assert(!account.empty()); |