aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-09-13 13:18:59 -0700
committerGerald Combs <gerald@wireshark.org>2018-09-13 20:48:56 +0000
commitaeadce847863a4fe949169f300d705d426f65b96 (patch)
tree4ad8bfe30c0be18d372c93d5160caed629fc1acd
parentf55c33d4b80b717e6316b928934e79a3775879b4 (diff)
Prefs: Add a check for aliased protocol preferences.
Add a check to set_pref for aliased protocols alongside the checks for protocols we've renamed in the past. Change-Id: I62ad2ddb17d66bd7385635bfa6ca1dd58fad6ad5 Reviewed-on: https://code.wireshark.org/review/29651 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
-rw-r--r--epan/prefs.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/epan/prefs.c b/epan/prefs.c
index a02cac1..a14b6ca 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -5505,11 +5505,17 @@ set_pref(gchar *pref_name, const gchar *value, void *private_data _U_,
strcmp(pref_name, "isup_thin") == 0) {
/* This protocol was removed 7. July 2009 */
return PREFS_SET_OBSOLETE;
+ } else {
+ /* See if the module name matches any protocol aliases. */
+ header_field_info *hfinfo = proto_registrar_get_byalias(pref_name);
+ if (hfinfo) {
+ module = (module_t *) wmem_tree_lookup_string(prefs_modules, hfinfo->abbrev, WMEM_TREE_STRING_NOCASE);
+ }
}
if (module) {
- ws_g_warning ("Preference \"%s.%s\" has been converted to \"%s.%s.%s\"\n"
+ ws_g_warning ("Preference \"%s.%s\" has been converted to \"%s.%s\"\n"
"Save your preferences to make this change permanent.",
- pref_name, dotp+1, module->parent->name, pref_name, dotp+1);
+ pref_name, dotp+1, module->name, dotp+1);
prefs.unknown_prefs = TRUE;
}
}