Blank Durations

- Instead of dispalying '-' for a zero-length duration, nothing is ('') is
  displayed instead.  This allows a completely empty duration column to be
  culled by the rc.print.empty.columns=no feature.
- Unit tests updated accordingly.
This commit is contained in:
Paul Beckingham 2013-02-24 14:26:52 -05:00
parent 089b3e7d66
commit 330761e997
4 changed files with 27 additions and 26 deletions

View file

@ -282,7 +282,7 @@ std::string Duration::formatCompact () const
else if (_secs >= 3600) sprintf (formatted, "%s%dh", (_negative ? "-" : ""), (int) (_secs / 3600));
else if (_secs >= 60) sprintf (formatted, "%s%dm", (_negative ? "-" : ""), (int) (_secs / 60));
else if (_secs >= 1) sprintf (formatted, "%s%ds", (_negative ? "-" : ""), (int) _secs);
else strcpy (formatted, "-");
else formatted[0] = '\0';
return std::string (formatted);
}