Commit b49a58293bd9fd3d86c76867bed2bc5ef15bd51f
1 parent
e69fff6e
handles correctly empty segment argument in xml_syntax_error
Showing
1 changed file
with
20 additions
and
6 deletions
src/xml/GException_xml.cpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GException_xml.cpp - XML exception handlers * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2010 by Jurgen Knodlseder * | |
| 4 | + * copyright (C) 2010-2011 by Jurgen Knodlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | - * This program is free software; you can redistribute it and/or modify * | |
| 8 | - * it under the terms of the GNU General Public License as published by * | |
| 9 | - * the Free Software Foundation; either version 2 of the License, or * | |
| 10 | - * (at your option) any later version. * | |
| 7 | + * This program is free software: you can redistribute it and/or modify * | |
| 8 | + * it under the terms of the GNU General Public License as published by * | |
| 9 | + * the Free Software Foundation, either version 3 of the License, or * | |
| 10 | + * (at your option) any later version. * | |
| 11 | + * * | |
| 12 | + * This program is distributed in the hope that it will be useful, * | |
| 13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of * | |
| 14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | |
| 15 | + * GNU General Public License for more details. * | |
| 16 | + * * | |
| 17 | + * You should have received a copy of the GNU General Public License * | |
| 18 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. * | |
| 11 | 19 | * * |
| 12 | 20 | ***************************************************************************/ |
| 13 | 21 | |
| ... | ... | @@ -32,7 +40,13 @@ GException::xml_syntax_error::xml_syntax_error(std::string origin, |
| 32 | 40 | { |
| 33 | 41 | // Set origin and message |
| 34 | 42 | m_origin = origin; |
| 35 | - m_message = "XML syntax error ("+message+") occured in "+segment; | |
| 43 | + | |
| 44 | + // Set message | |
| 45 | + m_message = "XML syntax error ("+message+")"; | |
| 46 | + | |
| 47 | + // Set segment | |
| 48 | + if (segment.length() > 0) | |
| 49 | + m_message += " occured in "+segment; | |
| 36 | 50 | |
| 37 | 51 | // Return |
| 38 | 52 | return; | ... | ... |