# HG changeset patch # User Eric Warmenhoven # Date 1001012982 0 # Node ID a6d0edc315547392cabe93f5d3f05e009e3dc4b3 # Parent 14c8df9cc75f0cc9e8f0a0f26480ceefd6c45d9a [gaim-migrate @ 2339] load perl on demand committer: Tailor Script diff -r 14c8df9cc75f -r a6d0edc31554 src/aim.c --- a/src/aim.c Thu Sep 20 19:03:57 2001 +0000 +++ b/src/aim.c Thu Sep 20 19:09:42 2001 +0000 @@ -617,7 +617,6 @@ gtkspell_start(NULL, ispell_cmd); #ifdef USE_PERL - perl_init(); perl_autoload(); #endif static_proto_init(); diff -r 14c8df9cc75f -r a6d0edc31554 src/gaim.h --- a/src/gaim.h Thu Sep 20 19:03:57 2001 +0000 +++ b/src/gaim.h Thu Sep 20 19:09:42 2001 +0000 @@ -792,7 +792,6 @@ /* Functions in perl.c */ #ifdef USE_PERL -extern void perl_init(); extern void perl_autoload(); extern int perl_load_file(char *); extern void perl_end(); diff -r 14c8df9cc75f -r a6d0edc31554 src/perl.c --- a/src/perl.c Thu Sep 20 19:03:57 2001 +0000 +++ b/src/perl.c Thu Sep 20 19:09:42 2001 +0000 @@ -82,6 +82,7 @@ static GList *perl_event_handlers = NULL; static PerlInterpreter *my_perl = NULL; static char* last_dir = NULL; +static void perl_init(); /* dealing with gaim */ XS(XS_GAIM_register); /* set up hooks for script */ @@ -146,6 +147,8 @@ int perl_load_file(char *script_name) { SV *return_val; + if (my_perl == NULL) + perl_init(); return_val = execute_perl("load_file", script_name); return SvNV (return_val); } @@ -186,7 +189,7 @@ g_free(path); } -void perl_init() +static void perl_init() { char *perl_args[] = {"", "-e", "0", "-w"}; char load_file[] =