aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-08-17 22:27:15 +0000
committerGerald Combs <gerald@wireshark.org>2005-08-17 22:27:15 +0000
commit4d9c7cfa0db236b6abf423eefeed5f21bfcd171b (patch)
tree3e0ee8d689084ae2411adbf22e56fca5db65f696 /epan
parent2b35007cbd66f00a6b3698fae5c34e79cd25be00 (diff)
Flip the separators in the MIBS environment variable between ":" and
";" depending on our platform. This is a modified version of a patch that Jaap Keuter sent in. Leave the preferences tooltip as-is in case we want to be more strict about separators in the future. Add a link to an email from Wes explaining that we shouldn't use a default MIB list. svn path=/trunk/; revision=15395
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-snmp.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c
index 8bcb4cf349..715d2da6c8 100644
--- a/epan/dissectors/packet-snmp.c
+++ b/epan/dissectors/packet-snmp.c
@@ -123,13 +123,15 @@ static int proto_snmp = -1;
/* Default MIB modules to load */
/*
- * XXX - Should we try to be clever and replace colons for semicolons under
- * Windows and the converse on non-Windows systems?
+ * XXX - According to Wes Hardaker, we shouldn't do this:
+ * http://www.ethereal.com/lists/ethereal-dev/200412/msg00222.html
*/
#ifdef _WIN32
# define DEF_MIB_MODULES "IP-MIB;IF-MIB;TCP-MIB;UDP-MIB;SNMPv2-MIB;RFC1213-MIB;UCD-SNMP-MIB"
+# define IMPORT_SEPARATOR ":"
#else
# define DEF_MIB_MODULES "IP-MIB:IF-MIB:TCP-MIB:UDP-MIB:SNMPv2-MIB:RFC1213-MIB:UCD-SNMP-MIB"
+# define IMPORT_SEPARATOR ";"
#endif /* _WIN32 */
static const gchar *mib_modules = DEF_MIB_MODULES;
@@ -2586,6 +2588,14 @@ process_prefs(void)
*/
if (mib_modules != NULL) {
tmp_mib_modules = g_strconcat("MIBS=", mib_modules, NULL);
+ /*
+ * Try to be clever and replace colons for semicolons under
+ * Windows. Do the converse on non-Windows systems. This
+ * handles cases where we've copied a preferences file
+ * between a non-Windows box and a Windows box or upgraded
+ * from an older version of Ethereal under Windows.
+ */
+ g_strdelimit(tmp_mib_modules, IMPORT_SEPARATOR, ENV_SEPARATOR_CHAR);
#ifdef _WIN32
_putenv(tmp_mib_modules);