Script name is printed now correctly if there's an error in

timeouts/signals.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1688 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-07-30 12:56:57 +00:00 committed by cras
commit 82034efb11
5 changed files with 66 additions and 9 deletions

View file

@ -50,12 +50,29 @@ static GHashTable *iobject_stashes, *plain_stashes;
static GSList *use_protocols;
/* returns the package who called us */
char *perl_get_package(void)
const char *perl_get_package(void)
{
STRLEN n_a;
return SvPV(perl_eval_pv("caller", TRUE), n_a);
}
/* Parses the package part from function name */
char *perl_function_get_package(const char *function)
{
const char *p;
int pos;
pos = 0;
for (p = function; *p != '\0'; p++) {
if (*p == ':' && p[1] == ':') {
if (++pos == 3)
return g_strndup(function, (int) (p-function));
}
}
return NULL;
}
SV *irssi_bless_iobject(int type, int chat_type, void *object)
{
PERL_OBJECT_REC *rec;