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

v2.8-utf8proc
Sebastien Helleu 2012-02-25 08:42:00 +01:00
parent f38f62e7d8
commit 496c7d3e18
2 changed files with 7 additions and 2 deletions

View File

@ -1,12 +1,14 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.3.7-rc3, 2012-02-20
v0.3.7-rc3, 2012-02-25
Version 0.3.7 (under dev!)
--------------------------
* core: fix expand of path "~" to home of user in function string_expand_home
("~/xxx" was ok, but not "~")
* core: fix memory leak when closing buffer
* core: fix memory leak in function util_search_full_lib_name
* core: automatically add newline char after last pasted line (when pasting many

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");