From: Sami Kerola Date: Tue, 27 Aug 2013 10:48:54 +0000 (+0100) Subject: last: fix --present option logic error X-Git-Tag: v2.24-rc1~311 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e01db8842507cf3f2cadab7efedfac8e3ba1423;p=thirdparty%2Futil-linux.git last: fix --present option logic error Printing of sessions 'still logged in' was skipped because an error in logic. Signed-off-by: Sami Kerola --- 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));