]> granicus.if.org Git - mutt/commitdiff
Revert showing real size for small files in mutt_pretty_size().
authorKevin McCarthy <kevin@8t8.us>
Sun, 3 Jun 2018 21:52:37 +0000 (14:52 -0700)
committerKevin McCarthy <kevin@8t8.us>
Sun, 3 Jun 2018 21:52:37 +0000 (14:52 -0700)
I thought the change made in 0fa64ba9 was small enough not to matter,
but at least one long-time user took the time to track down the change
and request it be reverted.

muttlib.c

index 7d280cd1313d0d2850e66bc534d47fd673ac64b4..39f5754aea281d28e6a585ef020933e0bf6591e4 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -902,8 +902,12 @@ void mutt_pretty_mailbox (char *s, size_t buflen)
 
 void mutt_pretty_size (char *s, size_t len, LOFF_T n)
 {
-  if (n < 1000)
-    snprintf (s, len, "%d", (int)n);
+  if (n == 0)
+    strfcpy (s, "0K", len);
+  /* Change in format released in 1.10.0, but reverted after feedback:
+   * if (n < 1000)
+   *  snprintf (s, len, "%d", (int)n);
+   */
   else if (n < 10189) /* 0.1K - 9.9K */
     snprintf (s, len, "%3.1fK", (n < 103) ? 0.1 : n / 1024.0);
   else if (n < 1023949) /* 10K - 999K */