summaryrefslogtreecommitdiff
path: root/src/perl
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2017-11-30 11:17:05 +0100
committerailin-nemui <ailin-nemui@users.noreply.github.com>2017-11-30 11:17:05 +0100
commit2b918fd9b8438eeef8f33556723140263e36f731 (patch)
tree0bdda333a8822fe71c60e42d19a3078019ee38d0 /src/perl
parentb332d448f7e3c7e4b40ea4a08932d0bd46007bbf (diff)
downloadirssi-2b918fd9b8438eeef8f33556723140263e36f731.zip
move decls before code
Diffstat (limited to 'src/perl')
-rw-r--r--src/perl/common/Expando.xs3
-rw-r--r--src/perl/textui/Statusbar.xs4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/perl/common/Expando.xs b/src/perl/common/Expando.xs
index 26800b05..84853a02 100644
--- a/src/perl/common/Expando.xs
+++ b/src/perl/common/Expando.xs
@@ -74,6 +74,7 @@ static char *perl_expando_event(PerlExpando *rec, SERVER_REC *server,
ret = NULL;
if (SvTRUE(ERRSV)) {
+ char *error;
PERL_SCRIPT_REC *script = rec->script;
(void) POPs;
@@ -85,7 +86,7 @@ static char *perl_expando_event(PerlExpando *rec, SERVER_REC *server,
script_unregister_expandos(script);
/* rec has been freed now */
- char *error = g_strdup(SvPV_nolen(ERRSV));
+ error = g_strdup(SvPV_nolen(ERRSV));
signal_emit("script error", 2, script, error);
g_free(error);
} else if (retcount > 0) {
diff --git a/src/perl/textui/Statusbar.xs b/src/perl/textui/Statusbar.xs
index 8b0e5f65..111deaa7 100644
--- a/src/perl/textui/Statusbar.xs
+++ b/src/perl/textui/Statusbar.xs
@@ -67,7 +67,7 @@ static void perl_statusbar_event(char *function, SBAR_ITEM_REC *item,
if (SvTRUE(ERRSV)) {
PERL_SCRIPT_REC *script;
- char *package;
+ char *package, *error;
package = perl_function_get_package(function);
script = perl_script_find_package(package);
@@ -78,7 +78,7 @@ static void perl_statusbar_event(char *function, SBAR_ITEM_REC *item,
script_unregister_statusbars(script);
}
- char *error = g_strdup(SvPV_nolen(ERRSV));
+ error = g_strdup(SvPV_nolen(ERRSV));
signal_emit("script error", 2, script, error);
g_free(error);
} else {