mirror of
https://github.com/weechat/weechat.git
synced 2026-06-30 23:06:38 +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:
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user