From bee03d70bf007ab9f0b619f97bf772b220840d33 Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 27 May 2004 09:16:47 +0000 Subject: [PATCH] (m17n_init): Increament shell_initialized. (m17n_fini): Decremented shell_initialized. --- src/m17n.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 (); } -- 1.7.10.4