--- queryimmodules.c	2004-03-07 05:55:24.000000000 +1100
+++ queryimmodules2.c	2004-04-25 22:52:07.000000000 +1000
@@ -81,10 +81,15 @@
 query_module (const char *dir, const char *name)
 {
   void          (*list)   (const GtkIMContextInfo ***contexts,
- 		           guint                    *n_contexts);
-  void          (*init)   (GTypeModule              *type_module);
-  void          (*exit)   (void);
-  GtkIMContext *(*create) (const gchar             *context_id);
+ 		           guint                    *n_contexts)=NULL;
+  void          (*init)   (GTypeModule              *type_module)=NULL;
+  void          (*exit)   (void)=NULL;
+  GtkIMContext *(*create) (const gchar             *context_id)=NULL;
+
+  gpointer	plist;
+  gpointer	pinit;
+  gpointer	pexit;
+  gpointer	pcreate;
 
   GModule *module;
   gchar *path;
@@ -104,15 +109,20 @@
     }
 	  
   if (module &&
-      g_module_symbol (module, "im_module_list", (gpointer *) &list) &&
-      g_module_symbol (module, "im_module_init", (gpointer *) &init) &&
-      g_module_symbol (module, "im_module_exit", (gpointer *) &exit) &&
-      g_module_symbol (module, "im_module_create", (gpointer *) &create))
+      g_module_symbol (module, "im_module_list", (gpointer *) &plist) &&
+      g_module_symbol (module, "im_module_init", (gpointer *) &pinit) &&
+      g_module_symbol (module, "im_module_exit", (gpointer *) &pexit) &&
+      g_module_symbol (module, "im_module_create", (gpointer *) &pcreate))
     {
       const GtkIMContextInfo **contexts;
       guint n_contexts;
       int i;
 
+      list = plist;
+      init = pinit;
+      exit = pexit;
+      create = pcreate;
+
       print_escaped (path);
       fputs ("\n", stdout);
 
