From 65a6e49964a1764ddcf434eea08f57f82420ac78 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 2 Jun 2000 01:49:10 +0000 Subject: [PATCH] If we used /SB GOTO 23:59 or something, we wanted to jump to previous day's 23:59 time instead of into future.. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@277 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/gui-textwidget.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/fe-text/gui-textwidget.c b/src/fe-text/gui-textwidget.c index f72229c6..49841479 100644 --- a/src/fe-text/gui-textwidget.c +++ b/src/fe-text/gui-textwidget.c @@ -319,6 +319,18 @@ static void cmd_scrollback_goto(gchar *data) sscanf(arg2, "%d:%d:%d", &tm.tm_hour, &tm.tm_min, &tm.tm_sec); stamp = mktime(&tm); + if (stamp > time(NULL) && arg1 == arg2) { + /* we used /SB GOTO 23:59 or something, we want to jump to + previous day's 23:59 time instead of into future. */ + stamp -= 3600*24; + } + + if (stamp > time(NULL)) { + /* we're still looking into future, don't bother checking */ + g_free(params); + return; + } + /* find the first line after timestamp */ for (pos = WINDOW_GUI(active_win)->lines; pos != NULL; pos = pos->next) {