Bugzilla Bug 255633: allow hyphen (-) and underscore (_) in log module

names.  The patch is contributed by Ed Catmur <ed@catmur.co.uk>. r=wtc.
This commit is contained in:
wtchang%redhat.com 2005-03-09 22:34:20 +00:00
parent fd0b9de018
commit e883f3a4c1

View File

@ -219,7 +219,7 @@ void _PR_InitLog(void)
PRInt32 bufSize = DEFAULT_BUF_SIZE;
while (pos < evlen) {
PRIntn level = 1, count = 0, delta = 0;
count = sscanf(&ev[pos], "%63[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789]%n:%d%n",
count = sscanf(&ev[pos], "%63[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_]%n:%d%n",
module, &delta, &level, &delta);
pos += delta;
if (count == 0) break;
@ -328,7 +328,7 @@ static void _PR_SetLogModuleLevel( PRLogModuleInfo *lm )
while (pos < evlen) {
PRIntn level = 1, count = 0, delta = 0;
count = sscanf(&ev[pos], "%63[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789]%n:%d%n",
count = sscanf(&ev[pos], "%63[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_]%n:%d%n",
module, &delta, &level, &delta);
pos += delta;
if (count == 0) break;