]> Dogcows Code - chaz/openbox/commitdiff
Fix the ~ expansion regex
authorMikael Magnusson <mikachu@gmail.com>
Fri, 8 Jan 2010 20:07:04 +0000 (21:07 +0100)
committerMikael Magnusson <mikachu@gmail.com>
Fri, 8 Jan 2010 20:07:05 +0000 (21:07 +0100)
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.

parser/parse.c

index ed66f088f6ba33f715b805fce01a25e5123a427e..897d738f417fbe183e78246d9cb7a28cdfb09580 100644 (file)
@@ -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);
 
This page took 0.024042 seconds and 4 git commands to generate.