mirror of
https://github.com/weechat/weechat.git
synced 2026-06-25 04:16:38 +02:00
Add function "string_expand_home" in plugin API, fix bug with replacement of home in paths
This commit is contained in:
@@ -482,19 +482,7 @@ script_search_path (struct t_weechat_plugin *weechat_plugin,
|
||||
struct stat st;
|
||||
|
||||
if (filename[0] == '~')
|
||||
{
|
||||
dir_home = getenv ("HOME");
|
||||
if (!dir_home)
|
||||
return NULL;
|
||||
length = strlen (dir_home) + strlen (filename + 1) + 1;
|
||||
final_name = malloc (length);
|
||||
if (final_name)
|
||||
{
|
||||
snprintf (final_name, length, "%s%s", dir_home, filename + 1);
|
||||
return final_name;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
return weechat_string_expand_home (filename);
|
||||
|
||||
dir_home = weechat_info_get ("weechat_dir", "");
|
||||
if (dir_home)
|
||||
|
||||
Reference in New Issue
Block a user