[gtk/4.0-backports: 8/53] modules: Simplify _gtk_get_module_path
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/4.0-backports: 8/53] modules: Simplify _gtk_get_module_path
- Date: Sun, 7 Feb 2021 17:49:40 +0000 (UTC)
commit 6161168706440706a5cee1dee01f9a5079d13c3d
Author: Jan Alexander Steffens (heftig) <jan steffens gmail com>
Date: Mon Jan 25 22:33:46 2021 +0100
modules: Simplify _gtk_get_module_path
Remove the bizarre loops.
gtk/gtkmodules.c | 22 ++++------------------
1 file changed, 4 insertions(+), 18 deletions(-)
---
diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c
index 9e487a64d6..aace5dcbc9 100644
--- a/gtk/gtkmodules.c
+++ b/gtk/gtkmodules.c
@@ -160,24 +160,10 @@ _gtk_get_module_path (const char *type)
count = 0;
for (path = get_module_path (); *path; path++)
{
- int use_version, use_host;
-
- for (use_version = TRUE; use_version >= FALSE; use_version--)
- for (use_host = TRUE; use_host >= FALSE; use_host--)
- {
- char *tmp_dir;
-
- if (use_version && use_host)
- tmp_dir = g_build_filename (*path, GTK_BINARY_VERSION, GTK_HOST, type, NULL);
- else if (use_version)
- tmp_dir = g_build_filename (*path, GTK_BINARY_VERSION, type, NULL);
- else if (use_host)
- tmp_dir = g_build_filename (*path, GTK_HOST, type, NULL);
- else
- tmp_dir = g_build_filename (*path, type, NULL);
-
- result[count++] = tmp_dir;
- }
+ result[count++] = g_build_filename (*path, GTK_BINARY_VERSION, GTK_HOST, type, NULL);
+ result[count++] = g_build_filename (*path, GTK_BINARY_VERSION, type, NULL);
+ result[count++] = g_build_filename (*path, GTK_HOST, type, NULL);
+ result[count++] = g_build_filename (*path, type, NULL);
}
result[count++] = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]