From: handa Date: Thu, 27 May 2004 09:16:47 +0000 (+0000) Subject: (m17n_init): Increament shell_initialized. X-Git-Tag: withdl~166 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bee03d70bf007ab9f0b619f97bf772b220840d33;p=m17n%2Fm17n-lib.git (m17n_init): Increament shell_initialized. (m17n_fini): Decremented shell_initialized. --- diff --git a/src/m17n.c b/src/m17n.c index 42e537b..90bdd20 100644 --- a/src/m17n.c +++ b/src/m17n.c @@ -42,7 +42,7 @@ m17n_init (void) { int mdebug_mask = MDEBUG_INIT; - if (shell_initialized) + if (shell_initialized++) return; m17n_init_core (); if (merror_code != MERROR_NONE) @@ -76,7 +76,6 @@ m17n_init (void) if (minput__init () < 0) goto err; MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize input module.")); - shell_initialized = 1; err: MDEBUG_POP_TIME (); @@ -89,8 +88,11 @@ m17n_fini (void) { 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.")); @@ -110,7 +112,6 @@ m17n_fini (void) MDEBUG_POP_TIME (); MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize the shell modules.")); MDEBUG_POP_TIME (); - shell_initialized = 0; } m17n_fini_core (); }