Print error message when we can't parse a .ini assignment line.

--HG--
extra : convert_revision : b7e19ff42ddd9a21571e086c11e143d9290e0e38
This commit is contained in:
Steve Reinhardt 2003-10-23 18:51:12 -07:00
parent 35a0764307
commit 21c7ee1e3e

View file

@ -217,8 +217,11 @@ bool
IniFile::Section::add(const std::string &assignment) IniFile::Section::add(const std::string &assignment)
{ {
string::size_type offset = assignment.find('='); string::size_type offset = assignment.find('=');
if (offset == string::npos) // no '=' found if (offset == string::npos) {
// no '=' found
cerr << "Can't parse .ini line " << assignment << endl;
return false; return false;
}
// if "+=" rather than just "=" then append value // if "+=" rather than just "=" then append value
bool append = (assignment[offset-1] == '+'); bool append = (assignment[offset-1] == '+');