Merge branch 'lakerka/procps-patch1'

* lakerka/procps-patch1:
  whattime: Fix formatting
  whattime: Show 0 minutes in pretty output
This commit is contained in:
Craig Small 2017-09-23 17:34:37 +10:00
commit 04835608dd

View File

@ -146,9 +146,9 @@ char *sprint_uptime(int human_readable) {
comma += 1;
}
if (upminutes) {
if (upminutes || (!upminutes && uptime_secs < 60)) {
pos += sprintf(buf + pos, "%s%d %s", comma > 0 ? ", " : "", upminutes,
upminutes > 1 ? "minutes" : "minute");
upminutes != 1 ? "minutes" : "minute");
comma += 1;
}
}