зеркало из https://github.com/mozilla/pjs.git
The lm argument for _PR_SetLogModuleLevel is
shadowed by a local variable by the same name. Rewrote the code to make it more clear. Thanks to Kathy Brade <brade@netscape.com> for reporting this bug.
This commit is contained in:
Родитель
dd642f2028
Коммит
3d95f8cd6e
|
@ -268,8 +268,6 @@ static void _PR_SetLogModuleLevel( PRLogModuleInfo *lm )
|
|||
PRIntn evlen = strlen(ev), pos = 0;
|
||||
while (pos < evlen) {
|
||||
PRIntn level = 1, count = 0, delta = 0;
|
||||
PRLogModuleInfo *lm = logModules;
|
||||
PRBool skip_modcheck;
|
||||
|
||||
count = sscanf(&ev[pos], "%64[A-Za-z0-9]%n:%d%n",
|
||||
module, &delta, &level, &delta);
|
||||
|
@ -280,19 +278,14 @@ static void _PR_SetLogModuleLevel( PRLogModuleInfo *lm )
|
|||
** If count == 2, then we got module and level. If count
|
||||
** == 1, then level defaults to 1 (module enabled).
|
||||
*/
|
||||
skip_modcheck = (0 == strcasecmp (module, "all")) ? PR_TRUE : PR_FALSE;
|
||||
while (lm != NULL)
|
||||
if (lm != NULL)
|
||||
{
|
||||
if (skip_modcheck)
|
||||
lm->level = (PRLogModuleLevel)level;
|
||||
else if (strcasecmp(module, lm->name) == 0)
|
||||
if ((strcasecmp(module, "all") == 0)
|
||||
|| (strcasecmp(module, lm->name) == 0))
|
||||
{
|
||||
lm->level = (PRLogModuleLevel)level;
|
||||
break;
|
||||
}
|
||||
lm = lm->next;
|
||||
}
|
||||
/*found:*/
|
||||
count = sscanf(&ev[pos], " , %n", &delta);
|
||||
pos += delta;
|
||||
if (count == -1) break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче