(resolve_command): Adjusted for the format change of
[m17n/m17n-lib.git] / src / m17n-core.c
index 672b740..c400a83 100644 (file)
 #include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <unistd.h>
@@ -534,7 +535,12 @@ m17n_init_core (void)
 
     mdebug__output = NULL;
     if (env_value)
-      mdebug__output = fopen (env_value, "a");
+      {
+       if (strcmp (env_value, "stdout"))
+         mdebug__output = stdout;
+       else
+         mdebug__output = fopen (env_value, "a");
+      }
     if (! mdebug__output)
       mdebug__output = stderr;
   }
@@ -576,16 +582,18 @@ m17n_fini_core (void)
 
   MDEBUG_PUSH_TIME ();
   MDEBUG_PUSH_TIME ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize chartable module."));
   mchartable__fini ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize textprop module."));
-  mtext__prop_fini ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize mtext module."));
+  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize chartable module."));
   mtext__fini ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize symbol module."));
+  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize mtext module."));
   msymbol__fini ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize plist module."));
+  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize symbol module."));
   mplist__fini ();
+  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize plist module."));
+  /* We must call this after the aboves because it frees interval
+     pools.  */
+  mtext__prop_fini ();
+  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize textprop module."));
   MDEBUG_POP_TIME ();
   MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize the core modules."));
   MDEBUG_POP_TIME ();