From b543af60b3b625f978bec0eacc7da31cd9d347f6 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 1 Sep 2003 00:53:55 +0000 Subject: move expand_tilde to ob_expand_tilde in openbox.c to make it global. use it on the command read in the menu parsing for pipe menus. use it on the command read for execute/restart actions. --- openbox/config.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'openbox/config.c') diff --git a/openbox/config.c b/openbox/config.c index 24da3060..21f03d3e 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -4,6 +4,7 @@ #include "prop.h" #include "translate.h" #include "parser/parse.h" +#include "openbox.h" gboolean config_focus_new; gboolean config_focus_follow; @@ -39,16 +40,6 @@ GSList *config_menu_files; gint config_resist_win; gint config_resist_edge; -gchar *expand_tilde(const gchar *f) -{ - if (!f) - return NULL; - else if (f[0] != '~') - return g_strdup(f); - else - return g_strconcat(g_get_home_dir(), f+1, NULL); -} - /* @@ -228,7 +219,7 @@ static void parse_theme(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, g_free(config_theme); c = parse_string(doc, n); - config_theme = expand_tilde(c); + config_theme = ob_expand_tilde(c); g_free(c); } if ((n = parse_find_node("titleLayout", node))) { @@ -343,7 +334,7 @@ static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, void *d) c = parse_string(doc, node); config_menu_files = g_slist_append(config_menu_files, - expand_tilde(c)); + ob_expand_tilde(c)); g_free(c); } } -- cgit v1.2.3