summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--parser/parse.c10
2 files changed, 7 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 53e50013..bba1b5c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,7 +70,7 @@ if test "$SED" = "no"; then
AC_MSG_ERROR([The program "sed" is not available. This program is required to build Openbox.])
fi
-PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.6.0])
+PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.14.0])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
diff --git a/parser/parse.c b/parser/parse.c
index 636b451f..ed66f088 100644
--- a/parser/parse.c
+++ b/parser/parse.c
@@ -456,14 +456,16 @@ void parse_paths_shutdown(void)
gchar *parse_expand_tilde(const gchar *f)
{
- gchar **spl;
gchar *ret;
+ GRegex *regex;
if (!f)
return NULL;
- spl = g_strsplit(f, "~", 0);
- ret = g_strjoinv(g_get_home_dir(), spl);
- g_strfreev(spl);
+
+ regex = g_regex_new("(?:^|(?<=[ \\t]))~(?=[/ \\t$])", G_REGEX_MULTILINE | G_REGEX_RAW, 0, NULL);
+ ret = g_regex_replace_literal(regex, f, -1, 0, g_get_home_dir(), 0, NULL);
+ g_regex_unref(regex);
+
return ret;
}