diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2018-04-10 21:26:15 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2018-04-10 21:26:15 +0200 |
commit | 3467d6eb430d132ff94e04ad7485d8f705317099 (patch) | |
tree | bcf6a9684d2f08c41e50ec95963be55ddb53144a /src/plugins/perl | |
parent | 9a969c41dbd938f598fd06f2dee8bbd3feafea57 (diff) | |
download | weechat-3467d6eb430d132ff94e04ad7485d8f705317099.zip |
scripts: return long integer instead of string in function infolist_time
Diffstat (limited to 'src/plugins/perl')
-rw-r--r-- | src/plugins/perl/weechat-perl-api.c | 17 |
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) |