From 4e01db8842507cf3f2cadab7efedfac8e3ba1423 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Tue, 27 Aug 2013 11:48:54 +0100 Subject: [PATCH] last: fix --present option logic error Printing of sessions 'still logged in' was skipped because an error in logic. Signed-off-by: Sami Kerola --- login-utils/last.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/login-utils/last.c b/login-utils/last.c index e5a9c24329..3cbfa069dd 100644 --- a/login-utils/last.c +++ b/login-utils/last.c @@ -293,7 +293,7 @@ static int list(struct utmp *p, time_t t, int what, time_t present) */ tmp = (time_t)p->ut_time; - if (present && (present < tmp || 0 == t || t < present)) + if (present && (present < tmp || (0 < t && t < present))) return 0; strcpy(logintime, ctime(&tmp)); -- 2.47.3