all repos — openbox @ 416ee379eaf1b9c0fb98e0367bd0e19d67d51bbb

openbox fork - make it a bit more like ryudo

make ob_expand_tilde expand all tildes in the string
Dana Jansens danakj@orodu.net
commit

416ee379eaf1b9c0fb98e0367bd0e19d67d51bbb

parent

b90b0beaf930deb96e47eddab7b971d686052ea1

1 files changed, 9 insertions(+), 4 deletions(-)

jump to
M openbox/openbox.copenbox/openbox.c

@@ -417,10 +417,15 @@ }

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; }