diff options
author | Ruediger Meier | 2014-05-08 19:01:03 +0200 |
---|---|---|
committer | Ruediger Meier | 2014-05-10 15:17:42 +0200 |
commit | 6e69f1ee0f3ee12bf544d0598b57af1fcff24a56 (patch) | |
tree | 9a62d1d476af085f63ad058427ebb032817cdafd /login-utils/last.c | |
parent | last: minor cleanup if statements (diff) | |
download | kernel-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.c | 5 |
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: |