ALT Linux Bugzilla
– Attachment 5159 Details for
Bug 25938
Contains absolute paths in /etc/pango/pango.modules
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
proposed patch
pango-1.28.4-alt-modules.patch (text/plain), 3.78 KB, created by
Dmitry V. Levin
on 2011-10-11 00:55:02 MSK
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Dmitry V. Levin
Created:
2011-10-11 00:55:02 MSK
Size:
3.78 KB
patch
obsolete
>Do not store absolute pathnames for default modules > >* modules.c (find_or_create_module): When a relative pathname is given, >prepend the pango default modules directory to get the absolute >pathname. >* querymodules.c (query_module): Output names of modules found in the >pango default modules directory as relative to that directory. > >https://bugzilla.altlinux.org/show_bug.cgi?id=25938 > >--- pango/pango/modules.c >+++ pango/pango/modules.c >@@ -361,7 +361,11 @@ find_or_create_module (const char *raw_path) > else > #endif > { >- path = g_strdup (raw_path); >+ if (g_path_is_absolute (raw_path)) >+ path = g_strdup (raw_path); >+ else >+ path = g_build_filename (pango_get_lib_subdirectory (), >+ MODULE_VERSION, "modules", raw_path, NULL); > } > > module = g_hash_table_lookup (dlloaded_modules, path); >--- pango/pango/querymodules.c >+++ pango/pango/querymodules.c >@@ -110,6 +110,8 @@ string_from_script (PangoScript script) > return value->value_nick; > } > >+static char *pango_modules_directory; >+ > static void > query_module (const char *dir, const char *name) > { >@@ -145,18 +147,24 @@ query_module (const char *dir, const char *name) > > for (i=0; i<n_engines; i++) > { >+ const char *out_path; > const gchar *quote; > gchar *quoted_path; > >- if (string_needs_escape (path)) >+ if (!g_path_is_absolute (name) && !strcmp(dir, pango_modules_directory)) >+ out_path = name; >+ else >+ out_path = path; >+ >+ if (string_needs_escape (out_path)) > { > quote = "\""; >- quoted_path = escape_string (path); >+ quoted_path = escape_string (out_path); > } > else > { > quote = ""; >- quoted_path = g_strdup (path); >+ quoted_path = g_strdup (out_path); > } > > g_printf ("%s%s%s %s %s %s", quote, quoted_path, quote, >@@ -193,6 +201,29 @@ show_version(const char *name G_GNUC_UNUSED, > exit(0); > } > >+static void >+query_dir (const char *name) >+{ >+ GDir *dir; >+ const char *dent; >+ size_t len; >+ >+ if (!g_path_is_absolute (name)) >+ return; >+ dir = g_dir_open (name, 0, NULL); >+ if (!dir) >+ return; >+ >+ while ((dent = g_dir_read_name (dir))) >+ { >+ len = strlen (dent); >+ if (len > SOEXT_LEN && strcmp (dent + len - SOEXT_LEN, SOEXT) == 0) >+ query_module (name, dent); >+ } >+ >+ g_dir_close (dir); >+} >+ > int > main (int argc, char **argv) > { >@@ -232,43 +263,33 @@ main (int argc, char **argv) > "# Automatically generated file, do not edit\n" > "#\n"); > >+ pango_modules_directory = g_build_filename (pango_get_lib_subdirectory (), >+ MODULE_VERSION, >+ "modules", >+ NULL); >+ > if (argc == 1) /* No arguments given */ > { > char **dirs; > int i; > > path = pango_config_key_get ("Pango/ModulesPath"); >- if (!path) >- path = g_build_filename (pango_get_lib_subdirectory (), >- MODULE_VERSION, >- "modules", >- NULL); >- >- g_printf ("# ModulesPath = %s\n#\n", path); > >- dirs = pango_split_file_list (path); >+ g_printf ("# ModulesPath = %s\n#\n", path ? path : pango_modules_directory); > >- g_free (path); >- >- for (i=0; dirs[i]; i++) >+ if (path) > { >- GDir *dir = g_dir_open (dirs[i], 0, NULL); >- if (dir) >- { >- const char *dent; >+ dirs = pango_split_file_list (path); > >- while ((dent = g_dir_read_name (dir))) >- { >- int len = strlen (dent); >- if (len > SOEXT_LEN && strcmp (dent + len - SOEXT_LEN, SOEXT) == 0) >- query_module (dirs[i], dent); >- } >+ g_free (path); > >- g_dir_close (dir); >- } >- } >+ for (i=0; dirs[i]; i++) >+ query_dir (dirs[i]); > >- g_strfreev (dirs); >+ g_strfreev (dirs); >+ } >+ else >+ query_dir (pango_modules_directory); > } > else > { >@@ -280,5 +301,7 @@ main (int argc, char **argv) > g_free (cwd); > } > >+ g_free (pango_modules_directory); >+ > return 0; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 25938
: 5159