Ethereal-dev: [Ethereal-dev] Small patch for prefs.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Tomas Kukosa <tomas.kukosa@xxxxxxxxxxx>
Date: Thu, 13 Mar 2003 16:50:13 +0100
Hello,
  preference name chacking is too strict and I can not register
"tcp.port" preference for "tc" module (it is module in my plugin).
  Suggested solution is attached.

Regards,
  Tom
*** ethereal-2003-03-13/prefs.c	Wed Mar 12 20:45:52 2003
--- ethereal/prefs.c	Thu Mar 13 16:40:15 2003
***************
*** 429,435 ****
  		 * 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);
  	}
  
  	/*
--- 429,436 ----
  		 * 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) ||
! 			(((name[strlen(module->name)]) != '.') && ((name[strlen(module->name)]) != '_')));
  	}
  
  	/*