From 528e1e0c53da088889b4108b1ffb6173a520c96f Mon Sep 17 00:00:00 2001 From: peregrine Date: Wed, 8 Feb 2017 06:29:21 +0100 Subject: [Bug #1658320] Color names have additional numbers. Fixed bugs: - https://launchpad.net/bugs/1658320 (bzr r15494) --- src/id-clash.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/id-clash.cpp') diff --git a/src/id-clash.cpp b/src/id-clash.cpp index c284843b8..162cb9e89 100644 --- a/src/id-clash.cpp +++ b/src/id-clash.cpp @@ -373,9 +373,9 @@ void rename_id(SPObject *elem, Glib::ustring const &new_name) gchar *id = g_strdup(new_name.c_str()); //id is not empty here as new_name is check to be not empty g_strcanon (id, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.:", '_'); Glib::ustring new_name2 = id; //will not fail as id can not be NULL, see length check on new_name - g_free (id); if (!isalnum (new_name2[0])) { g_message("Invalid Id, will not change."); + g_free (id); return; } @@ -396,7 +396,7 @@ void rename_id(SPObject *elem, Glib::ustring const &new_name) break; } } - + g_free (id); // Change to the new ID elem->getRepr()->setAttribute("id", new_name2); // Make a note of this change, if we need to fix up refs to it -- cgit v1.2.3