diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-03-13 18:17:59 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-03-13 18:17:59 +0000 |
commit | d96139266f7a20dd172ebd25eb707caf8a786ef4 (patch) | |
tree | baf1c7cc1fff4cee7465335e5971a8789c64cfbd /prefs.c | |
parent | 43d8d2fb9507f43fcc754d0e25966376e026a408 (diff) |
From Tomas Kukosa - allow a preference name to begin with the string
that's the name of the module, as long as the prefix doesn't end with
"." or "_" (so you can register "tc.tcp.port" or "tc.tcp_port", but not
"tc.tc.port" or "tc.tc_port").
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7351 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'prefs.c')
-rw-r--r-- | prefs.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,7 +1,7 @@ /* prefs.c * Routines for handling preferences * - * $Id: prefs.c,v 1.97 2003/03/12 19:45:52 guy Exp $ + * $Id: prefs.c,v 1.98 2003/03/13 18:17:59 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -429,7 +429,8 @@ register_preference(module_t *module, const char *name, const char *title, * Make sure the preference name doesn't begin with the * module name, as that's redundant and Just Silly. */ - g_assert(strncmp(name, module->name, strlen(module->name)) != 0); + g_assert((strncmp(name, module->name, strlen(module->name)) != 0) || + (((name[strlen(module->name)]) != '.') && ((name[strlen(module->name)]) != '_'))); } /* |