mirror of
https://github.com/irssi/irssi.git
synced 2026-08-20 17:12:51 +02:00
Irssi::printformat() doesn't crash anymore if you try to use unregistered
format. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2143 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
ff16e15389
commit
f0ce4f221b
1 changed files with 6 additions and 1 deletions
|
|
@ -6,11 +6,16 @@ void printformat_perl(TEXT_DEST_REC *dest, char *format, char **arglist)
|
||||||
char *module, *str;
|
char *module, *str;
|
||||||
int formatnum;
|
int formatnum;
|
||||||
|
|
||||||
|
formatnum = format_find_tag(module, format);
|
||||||
|
if (formatnum < 0) {
|
||||||
|
die("printformat(): unregistered format '%s'", format);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
module = g_strdup(perl_get_package());
|
module = g_strdup(perl_get_package());
|
||||||
theme = dest->window->theme == NULL ? current_theme :
|
theme = dest->window->theme == NULL ? current_theme :
|
||||||
dest->window->theme;
|
dest->window->theme;
|
||||||
|
|
||||||
formatnum = format_find_tag(module, format);
|
|
||||||
signal_emit("print format", 5, theme, module,
|
signal_emit("print format", 5, theme, module,
|
||||||
&dest, GINT_TO_POINTER(formatnum), arglist);
|
&dest, GINT_TO_POINTER(formatnum), arglist);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue