747 |
|
|
748 |
void plugin_auto_load () |
void plugin_auto_load () |
749 |
{ |
{ |
750 |
char *dir_name; |
char *ptr_home, *dir_name; |
751 |
|
|
752 |
|
/* auto-load plugins in WeeChat home dir */ |
753 |
|
if (cfg_plugins_path && cfg_plugins_path[0]) |
754 |
|
{ |
755 |
|
if (cfg_plugins_path[0] == '~') |
756 |
|
{ |
757 |
|
ptr_home = getenv ("HOME"); |
758 |
|
dir_name = (char *)malloc (strlen (cfg_plugins_path) + strlen (ptr_home) + 2); |
759 |
|
if (dir_name) |
760 |
|
{ |
761 |
|
strcpy (dir_name, ptr_home); |
762 |
|
strcat (dir_name, cfg_plugins_path + 1); |
763 |
|
plugin_exec_on_files (NULL, dir_name, &plugin_auto_load_file); |
764 |
|
free (dir_name); |
765 |
|
} |
766 |
|
} |
767 |
|
else |
768 |
|
plugin_exec_on_files (NULL, cfg_plugins_path, &plugin_auto_load_file); |
769 |
|
} |
770 |
|
|
771 |
|
/* auto-load plugins in WeeChat global lib dir */ |
772 |
dir_name = (char *)malloc (strlen (WEECHAT_LIBDIR) + 16); |
dir_name = (char *)malloc (strlen (WEECHAT_LIBDIR) + 16); |
773 |
if (dir_name) |
if (dir_name) |
774 |
{ |
{ |