Index: pango/modules.c
===================================================================
RCS file: /cvs/gnome/pango/pango/modules.c,v
retrieving revision 1.61
diff -u -r1.61 modules.c
--- pango/modules.c	13 Sep 2006 21:32:09 -0000	1.61
+++ pango/modules.c	14 Sep 2006 16:32:49 -0000
@@ -39,6 +39,9 @@
 #define PANGO_MODULE(module) (G_TYPE_CHECK_INSTANCE_CAST ((module), PANGO_TYPE_MODULE, PangoModule))
 #define PANGO_IS_MODULE(module)  (G_TYPE_CHECK_INSTANCE_TYPE ((module), PANGO_TYPE_MODULE))
 
+#define MODULEFILEEXT ".modules"
+#define MODULEFILEEXT_LEN ((int) strlen (MODULEFILEEXT))
+
 typedef struct _PangoMapInfo PangoMapInfo;
 typedef struct _PangoEnginePair PangoEnginePair;
 typedef struct _PangoSubmap PangoSubmap;
@@ -518,11 +521,36 @@
 
   while (n-- > 0)
     {
-      module_file = g_fopen (files[n], "r");
-      if (module_file)
+      GDir *dir = g_dir_open (files[n], 0, NULL);
+      if (dir)
+	{
+	  const char *dent;
+
+	  while ((dent = g_dir_read_name (dir)))
+	    {
+	      int len = strlen (dent);
+	      if (len > MODULEFILEEXT_LEN && strcmp (dent + len - MODULEFILEEXT_LEN, MODULEFILEEXT) == 0)
+		{
+		  gchar *pathname = g_build_filename (files[n], dent, NULL);
+		  module_file = g_fopen (pathname, "r");
+		  if (module_file)
+		    {
+		      process_module_file(module_file);
+		      fclose(module_file);
+		    }
+		  g_free (pathname);
+		}
+	    }
+	  g_dir_close (dir);
+	}
+      else
 	{
-	  process_module_file(module_file);
-	  fclose(module_file);
+	  module_file = g_fopen (files[n], "r");
+	  if (module_file)
+	    {
+	      process_module_file(module_file);
+	      fclose(module_file);
+	    }
 	}
     }
 
