mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
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:
parent
4032addbf9
commit
7131ceb909
@ -242,8 +242,11 @@ static int perl_script_eval(PERL_SCRIPT_REC *script)
|
|||||||
if (error != NULL) {
|
if (error != NULL) {
|
||||||
if (*error == '\0')
|
if (*error == '\0')
|
||||||
error = NULL;
|
error = NULL;
|
||||||
else
|
else {
|
||||||
|
error = g_strdup(error);
|
||||||
signal_emit("script error", 2, script, error);
|
signal_emit("script error", 2, script, error);
|
||||||
|
g_free(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PUTBACK;
|
PUTBACK;
|
||||||
|
@ -160,7 +160,9 @@ static void perl_call_signal(PERL_SCRIPT_REC *script, SV *func,
|
|||||||
SPAGAIN;
|
SPAGAIN;
|
||||||
|
|
||||||
if (SvTRUE(ERRSV)) {
|
if (SvTRUE(ERRSV)) {
|
||||||
signal_emit("script error", 2, script, SvPV(ERRSV, PL_na));
|
char *error = g_strdup(SvPV(ERRSV, PL_na));
|
||||||
|
signal_emit("script error", 2, script, error);
|
||||||
|
g_free(error);
|
||||||
rec = NULL;
|
rec = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,8 +77,9 @@ static int perl_source_event(PERL_SOURCE_REC *rec)
|
|||||||
SPAGAIN;
|
SPAGAIN;
|
||||||
|
|
||||||
if (SvTRUE(ERRSV)) {
|
if (SvTRUE(ERRSV)) {
|
||||||
signal_emit("script error", 2, rec->script,
|
char *error = g_strdup(SvPV(ERRSV, PL_na));
|
||||||
SvPV(ERRSV, PL_na));
|
signal_emit("script error", 2, rec->script, error);
|
||||||
|
g_free(error);
|
||||||
}
|
}
|
||||||
perl_source_unref(rec);
|
perl_source_unref(rec);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user