From 550fcfc195905fd3a99fa249757c678ac734acc7 Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Tue, 6 Jan 2004 03:46:03 -0800 Subject: [PATCH] [PATCH] gconf startup fixes Let gconf find it's glade file, even it's started with an absolute path and check srcdir so it also works if it's compiled outside of the tree. --- scripts/kconfig/gconf.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index 792a0664c5abc..10d70e333ec95 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -1582,7 +1582,7 @@ void fixup_rootmenu(struct menu *menu) int main(int ac, char *av[]) { const char *name; - gchar *cur_dir, *exe_path; + char *env; gchar *glade_file; #ifndef LKC_DIRECT_LINK @@ -1598,12 +1598,13 @@ int main(int ac, char *av[]) //add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps"); /* Determine GUI path */ - cur_dir = g_get_current_dir(); - exe_path = g_strdup(av[0]); - exe_path[0] = '/'; - glade_file = g_strconcat(cur_dir, exe_path, ".glade", NULL); - g_free(cur_dir); - g_free(exe_path); + env = getenv(SRCTREE); + if (env) + glade_file = g_strconcat(env, "/scripts/kconfig/gconf.glade", NULL); + else if (av[0][0] == '/') + glade_file = g_strconcat(av[0], ".glade", NULL); + else + glade_file = g_strconcat(g_get_current_dir(), "/", av[0], ".glade", NULL); /* Load the interface and connect signals */ init_main_window(glade_file); -- 2.53.0