summaryrefslogtreecommitdiffstats
path: root/login-utils/last.c
diff options
context:
space:
mode:
authorSami Kerola2013-08-27 12:48:54 +0200
committerSami Kerola2013-08-29 19:14:09 +0200
commit4e01db8842507cf3f2cadab7efedfac8e3ba1423 (patch)
tree4b74066b95e5d66bc01996585cad8af36a64fe5d /login-utils/last.c
parentdocs: add --since and time option formats to last(1) manual (diff)
downloadkernel-qcow2-util-linux-4e01db8842507cf3f2cadab7efedfac8e3ba1423.tar.gz
kernel-qcow2-util-linux-4e01db8842507cf3f2cadab7efedfac8e3ba1423.tar.xz
kernel-qcow2-util-linux-4e01db8842507cf3f2cadab7efedfac8e3ba1423.zip
last: fix --present option logic error
Printing of sessions 'still logged in' was skipped because an error in logic. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'login-utils/last.c')
-rw-r--r--login-utils/last.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/login-utils/last.c b/login-utils/last.c
index e5a9c2432..3cbfa069d 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));