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.
This commit is contained in:
parent
ab061f5468
commit
2b0dfb81cf
1 changed files with 2 additions and 1 deletions
|
@ -462,7 +462,8 @@ gchar *parse_expand_tilde(const gchar *f)
|
||||||
if (!f)
|
if (!f)
|
||||||
return NULL;
|
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);
|
ret = g_regex_replace_literal(regex, f, -1, 0, g_get_home_dir(), 0, NULL);
|
||||||
g_regex_unref(regex);
|
g_regex_unref(regex);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue