summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2010-01-08 21:07:04 +0100
committerMikael Magnusson <mikachu@gmail.com>2010-01-08 21:07:05 +0100
commit2b0dfb81cfe60d40827f0231aac9a95adca33137 (patch)
tree16ebde5ebe45d36e8d10100e77a4b3e9a96e24e8
parentab061f54687c27d5fc835578374705951ee056e0 (diff)
Fix the ~ expansion regex
The look-around things are fixed-width but the [stuff] is 1 char, and the $ is 0 so it didn't work. I already used that trick for the ^, maybe it used to work due to a bug or smth.
-rw-r--r--parser/parse.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/parser/parse.c b/parser/parse.c
index ed66f088..897d738f 100644
--- a/parser/parse.c
+++ b/parser/parse.c
@@ -462,7 +462,8 @@ gchar *parse_expand_tilde(const gchar *f)
if (!f)
return NULL;
- regex = g_regex_new("(?:^|(?<=[ \\t]))~(?=[/ \\t$])", G_REGEX_MULTILINE | G_REGEX_RAW, 0, NULL);
+ 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);