g_strdup() the error message before emitting "script error" signal, since

perl scripting might be executed during that signal and it clears the error
message.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2302 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-01-10 17:36:41 +00:00 committed by cras
commit 7131ceb909
3 changed files with 10 additions and 4 deletions

View file

@ -77,8 +77,9 @@ static int perl_source_event(PERL_SOURCE_REC *rec)
SPAGAIN;
if (SvTRUE(ERRSV)) {
signal_emit("script error", 2, rec->script,
SvPV(ERRSV, PL_na));
char *error = g_strdup(SvPV(ERRSV, PL_na));
signal_emit("script error", 2, rec->script, error);
g_free(error);
}
perl_source_unref(rec);