summaryrefslogtreecommitdiffstats
path: root/login-utils/last.c
diff options
context:
space:
mode:
authorRuediger Meier2014-05-08 19:01:03 +0200
committerRuediger Meier2014-05-10 15:17:42 +0200
commit6e69f1ee0f3ee12bf544d0598b57af1fcff24a56 (patch)
tree9a62d1d476af085f63ad058427ebb032817cdafd /login-utils/last.c
parentlast: minor cleanup if statements (diff)
downloadkernel-qcow2-util-linux-6e69f1ee0f3ee12bf544d0598b57af1fcff24a56.tar.gz
kernel-qcow2-util-linux-6e69f1ee0f3ee12bf544d0598b57af1fcff24a56.tar.xz
kernel-qcow2-util-linux-6e69f1ee0f3ee12bf544d0598b57af1fcff24a56.zip
last: avoid leading "-" before "no logout"
This affects option --time-format=notime. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'login-utils/last.c')
-rw-r--r--login-utils/last.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/login-utils/last.c b/login-utils/last.c
index 3a802eda6..ba58c4433 100644
--- a/login-utils/last.c
+++ b/login-utils/last.c
@@ -465,9 +465,12 @@ static int list(const struct last_control *ctl, struct utmp *p, time_t t, int wh
if (ctl->time_fmt > LAST_TIMEFTM_SHORT_CTIME) {
sprintf(logouttime, " gone - no logout");
length[0] = 0;
- } else {
+ } else if (ctl->time_fmt == LAST_TIMEFTM_SHORT_CTIME) {
sprintf(logouttime, " gone");
sprintf(length, "- no logout");
+ } else {
+ logouttime[0] = 0;
+ sprintf(length, "no logout");
}
break;
case R_REBOOT: