1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-10 19:53:13 +02:00

core: fix expand of path "~" to home of user in function string_expand_home ("~/xxx" was ok, but not "~")

This commit is contained in:
Sebastien Helleu
2012-02-25 08:42:00 +01:00
parent f38f62e7d8
commit 496c7d3e18
2 changed files with 7 additions and 2 deletions
+4 -1
View File
@@ -476,8 +476,11 @@ string_expand_home (const char *path)
if (!path)
return NULL;
if (!path[0] || (path[0] != '~') || (path[1] != DIR_SEPARATOR_CHAR))
if (!path[0] || (path[0] != '~')
|| ((path[1] && path[1] != DIR_SEPARATOR_CHAR)))
{
return strdup (path);
}
ptr_home = getenv ("HOME");