View | Details | Raw Unified | Return to bug 25938
Collapse All | Expand All

(-)file_not_specified_in_diff (-31 / +58 lines)
Line  Link Here
0
-- pango/pango/modules.c
0
++ pango/pango/modules.c
Lines 361-367 find_or_create_module (const char *raw_path) Link Here
361
  else
361
  else
362
#endif
362
#endif
363
    {
363
    {
364
      path = g_strdup (raw_path);
364
      if (g_path_is_absolute (raw_path))
365
	path = g_strdup (raw_path);
366
      else
367
	path = g_build_filename (pango_get_lib_subdirectory (),
368
				 MODULE_VERSION, "modules", raw_path, NULL);
365
    }
369
    }
366
370
367
  module = g_hash_table_lookup (dlloaded_modules, path);
371
  module = g_hash_table_lookup (dlloaded_modules, path);
368
-- pango/pango/querymodules.c
372
++ pango/pango/querymodules.c
Lines 110-115 string_from_script (PangoScript script) Link Here
110
  return value->value_nick;
110
  return value->value_nick;
111
}
111
}
112
112
113
static char *pango_modules_directory;
114
113
static void
115
static void
114
query_module (const char *dir, const char *name)
116
query_module (const char *dir, const char *name)
115
{
117
{
Lines 145-162 query_module (const char *dir, const char *name) Link Here
145
147
146
      for (i=0; i<n_engines; i++)
148
      for (i=0; i<n_engines; i++)
147
	{
149
	{
150
	  const char *out_path;
148
	  const gchar *quote;
151
	  const gchar *quote;
149
	  gchar *quoted_path;
152
	  gchar *quoted_path;
150
153
151
	  if (string_needs_escape (path))
154
	  if (!g_path_is_absolute (name) && !strcmp(dir, pango_modules_directory))
155
	    out_path = name;
156
	  else
157
	    out_path = path;
158
159
	  if (string_needs_escape (out_path))
152
	    {
160
	    {
153
	      quote = "\"";
161
	      quote = "\"";
154
	      quoted_path = escape_string (path);
162
	      quoted_path = escape_string (out_path);
155
	    }
163
	    }
156
	  else
164
	  else
157
	    {
165
	    {
158
	      quote = "";
166
	      quote = "";
159
	      quoted_path = g_strdup (path);
167
	      quoted_path = g_strdup (out_path);
160
	    }
168
	    }
161
169
162
	  g_printf ("%s%s%s %s %s %s", quote, quoted_path, quote,
170
	  g_printf ("%s%s%s %s %s %s", quote, quoted_path, quote,
Lines 193-198 show_version(const char *name G_GNUC_UNUSED, Link Here
193
  exit(0);
201
  exit(0);
194
}
202
}
195
203
204
static void
205
query_dir (const char *name)
206
{
207
  GDir *dir;
208
  const char *dent;
209
  size_t len;
210
211
  if (!g_path_is_absolute (name))
212
    return;
213
  dir = g_dir_open (name, 0, NULL);
214
  if (!dir)
215
    return;
216
217
  while ((dent = g_dir_read_name (dir)))
218
    {
219
      len = strlen (dent);
220
      if (len > SOEXT_LEN && strcmp (dent + len - SOEXT_LEN, SOEXT) == 0)
221
	query_module (name, dent);
222
    }
223
224
  g_dir_close (dir);
225
}
226
196
int
227
int
197
main (int argc, char **argv)
228
main (int argc, char **argv)
198
{
229
{
Lines 232-274 main (int argc, char **argv) Link Here
232
	    "# Automatically generated file, do not edit\n"
263
	    "# Automatically generated file, do not edit\n"
233
	    "#\n");
264
	    "#\n");
234
265
266
  pango_modules_directory = g_build_filename (pango_get_lib_subdirectory (),
267
					      MODULE_VERSION,
268
					      "modules",
269
					      NULL);
270
235
  if (argc == 1)		/* No arguments given */
271
  if (argc == 1)		/* No arguments given */
236
    {
272
    {
237
      char **dirs;
273
      char **dirs;
238
      int i;
274
      int i;
239
275
240
      path = pango_config_key_get ("Pango/ModulesPath");
276
      path = pango_config_key_get ("Pango/ModulesPath");
241
      if (!path)
242
	path = g_build_filename (pango_get_lib_subdirectory (),
243
				 MODULE_VERSION,
244
				 "modules",
245
				 NULL);
246
247
      g_printf ("# ModulesPath = %s\n#\n", path);
248
277
249
      dirs = pango_split_file_list (path);
278
      g_printf ("# ModulesPath = %s\n#\n", path ? path : pango_modules_directory);
250
279
251
      g_free (path);
280
      if (path)
252
253
      for (i=0; dirs[i]; i++)
254
	{
281
	{
255
	  GDir *dir = g_dir_open (dirs[i], 0, NULL);
282
	  dirs = pango_split_file_list (path);
256
	  if (dir)
257
	    {
258
	      const char *dent;
259
283
260
	      while ((dent = g_dir_read_name (dir)))
284
	  g_free (path);
261
		{
262
		  int len = strlen (dent);
263
		  if (len > SOEXT_LEN && strcmp (dent + len - SOEXT_LEN, SOEXT) == 0)
264
		    query_module (dirs[i], dent);
265
		}
266
285
267
	      g_dir_close (dir);
286
	  for (i=0; dirs[i]; i++)
268
	    }
287
	    query_dir (dirs[i]);
269
	}
270
288
271
      g_strfreev (dirs);
289
	  g_strfreev (dirs);
290
	}
291
      else
292
	query_dir (pango_modules_directory);
272
    }
293
    }
273
  else
294
  else
274
    {
295
    {
Lines 280-284 main (int argc, char **argv) Link Here
280
      g_free (cwd);
301
      g_free (cwd);
281
    }
302
    }
282
303
304
  g_free (pango_modules_directory);
305
283
  return 0;
306
  return 0;
284
}
307
}

Return to bug 25938