...
 
Commits (2)
  • Kyle Laker's avatar
    whattime: Show 0 minutes in pretty output · 668394ba
    Kyle Laker authored
    When supplying the -p command to uptime, it does not display any
    sections where the value is less than 1; however, after a reboot, this
    causes the command to just output "up". Showing 0 minutes when the
    system has been up for less than a minute makes it clear a reboot just
    occurred.
    668394ba
  • Kyle Laker's avatar
    whattime: Fix formatting · 7b8eba40
    Kyle Laker authored
    Update formatting within the if block to two spaces
    7b8eba40
......@@ -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;
}
}
......