summaryrefslogtreecommitdiff
path: root/src/plugins/perl
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/perl')
-rw-r--r--src/plugins/perl/weechat-perl-api.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/plugins/perl/weechat-perl-api.c b/src/plugins/perl/weechat-perl-api.c
index 2ac22a3a1..bc57e2e0a 100644
--- a/src/plugins/perl/weechat-perl-api.c
+++ b/src/plugins/perl/weechat-perl-api.c
@@ -4469,28 +4469,19 @@ API_FUNC(infolist_pointer)
API_FUNC(infolist_time)
{
time_t time;
- struct tm *date_tmp;
- char timebuffer[64], *result, *infolist, *variable;
+ char *infolist, *variable;
dXSARGS;
- API_INIT_FUNC(1, "infolist_time", API_RETURN_EMPTY);
+ API_INIT_FUNC(1, "infolist_time", API_RETURN_LONG(0));
if (items < 2)
- API_WRONG_ARGS(API_RETURN_EMPTY);
+ API_WRONG_ARGS(API_RETURN_LONG(0));
infolist = SvPV_nolen (ST (0));
variable = SvPV_nolen (ST (1));
- timebuffer[0] = '\0';
time = weechat_infolist_time (API_STR2PTR(infolist), variable);
- date_tmp = localtime (&time);
- if (date_tmp)
- {
- if (strftime (timebuffer, sizeof (timebuffer), "%F %T", date_tmp) == 0)
- timebuffer[0] = '\0';
- }
- result = strdup (timebuffer);
- API_RETURN_STRING_FREE(result);
+ API_RETURN_LONG(time);
}
API_FUNC(infolist_free)