From b49a58293bd9fd3d86c76867bed2bc5ef15bd51f Mon Sep 17 00:00:00 2001 From: knodlseder <> Date: Fri, 25 Feb 2011 14:20:27 +0000 Subject: [PATCH] handles correctly empty segment argument in xml_syntax_error --- src/xml/GException_xml.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/xml/GException_xml.cpp b/src/xml/GException_xml.cpp index 2fd7b94..ac799a5 100644 --- a/src/xml/GException_xml.cpp +++ b/src/xml/GException_xml.cpp @@ -1,13 +1,21 @@ /*************************************************************************** * GException_xml.cpp - XML exception handlers * * ----------------------------------------------------------------------- * - * copyright (C) 2010 by Jurgen Knodlseder * + * copyright (C) 2010-2011 by Jurgen Knodlseder * * ----------------------------------------------------------------------- * * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * * * ***************************************************************************/ @@ -32,7 +40,13 @@ GException::xml_syntax_error::xml_syntax_error(std::string origin, { // Set origin and message m_origin = origin; - m_message = "XML syntax error ("+message+") occured in "+segment; + + // Set message + m_message = "XML syntax error ("+message+")"; + + // Set segment + if (segment.length() > 0) + m_message += " occured in "+segment; // Return return; -- libgit2 0.21.4