(m17n_fini): Decremented shell_initialized.
{
int mdebug_mask = MDEBUG_INIT;
- if (shell_initialized)
+ if (shell_initialized++)
return;
m17n_init_core ();
if (merror_code != MERROR_NONE)
if (minput__init () < 0)
goto err;
MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize input module."));
- shell_initialized = 1;
err:
MDEBUG_POP_TIME ();
{
int mdebug_mask = MDEBUG_FINI;
- if (shell_initialized)
+ if (shell_initialized > 1)
+ shell_initialized--;
+ else
{
+ shell_initialized = 0;
MDEBUG_PUSH_TIME ();
MDEBUG_PUSH_TIME ();
MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize input module."));
MDEBUG_POP_TIME ();
MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize the shell modules."));
MDEBUG_POP_TIME ();
- shell_initialized = 0;
}
m17n_fini_core ();
}