projects
/
dana
/
openbox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b90b0be
)
make ob_expand_tilde expand all tildes in the string
author
Dana Jansens
<danakj@orodu.net>
Mon, 1 Sep 2003 09:24:26 +0000
(09:24 +0000)
committer
Dana Jansens
<danakj@orodu.net>
Mon, 1 Sep 2003 09:24:26 +0000
(09:24 +0000)
openbox/openbox.c
patch
|
blob
|
history
diff --git
a/openbox/openbox.c
b/openbox/openbox.c
index 21f3a60604a6a0ba7854768668e069396feab506..4786ecc40ba4e6884ed79f0e2811bfaa5e3ff999 100644
(file)
--- a/
openbox/openbox.c
+++ b/
openbox/openbox.c
@@
-417,10
+417,15
@@
ObState ob_state()
gchar *ob_expand_tilde(const gchar *f)
{
+ gchar **spl;
+ gchar *ret, *mid;
+
if (!f)
return NULL;
- else if (f[0] != '~')
- return g_strdup(f);
- else
- return g_strconcat(g_get_home_dir(), f+1, NULL);
+ spl = g_strsplit(f, "~", 0);
+ mid = g_strconcat(g_get_home_dir(), G_DIR_SEPARATOR_S, NULL);
+ ret = g_strjoinv(mid, spl);
+ g_free(mid);
+ g_strfreev(spl);
+ return ret;
}