If old-name equals new-name, g_rename () will fail and cleanup
will delete new-path (which is equal to old-path)
const string old_name = item->get_value (_template_columns.name);
const string new_name = string (new_name_);
+ if (old_name == new_name) {
+ return;
+ }
+
const string old_file_old_path = Glib::build_filename (old_path, old_name+".template");
XMLTree tree;
const string old_filepath = item->get_value (_template_columns.path);
const string new_filepath = Glib::build_filename (user_route_template_directory(), new_name+".template");
+ if (old_name == new_name) {
+ return;
+ }
+
XMLTree tree;
if (!tree.read (old_filepath)) {
error << string_compose (_("Could not parse template file \"%1\"."), old_filepath) << endmsg;