UI: Rename profiles without delete

Do not try to delete the old profile name after renaming.  In most
cases it will not exist, but when using a case-insensitive file system
this will delete the renamed profile if only changing capitalizations
(first it's renamed and then it's deleted).

Change-Id: I27d2d22d2353b09f2041d82ea1cf1bae37a1ce3d
Reviewed-on: https://code.wireshark.org/review/25515
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Stig Bjørlykke 2018-01-30 12:27:30 +01:00 committed by Anders Broman
parent eda5c950b6
commit 043b45e840
1 changed files with 3 additions and 3 deletions

View File

@ -203,8 +203,6 @@ gchar *apply_profile_changes(void)
g_free(pf_dir_path2);
}
profile1->status = PROF_STAT_EXISTS;
g_free (profile1->reference);
profile1->reference = g_strdup(profile1->name);
}
}
fl1 = g_list_next(fl1);
@ -223,7 +221,9 @@ gchar *apply_profile_changes(void)
/* Profile exists in both lists */
found = TRUE;
} else if (strcmp(profile1->name, profile2->reference)==0) {
/* Profile has been renamed */
/* Profile has been renamed, update reference to the new name */
g_free (profile2->reference);
profile2->reference = g_strdup(profile2->name);
found = TRUE;
}
}