Subject: bug#65003: closed (Re: bug#65003: pinky's "Idle" column lost the unit)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 02 Aug 2023 13:55:02 +0000

Your bug report

#65003: pinky's "Idle" column lost the unit

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
65003: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65003
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#65003: pinky's "Idle" column lost the unit
From: Paul Eggert <[email-masked]>
To: Bruno Haible <[email-masked]>
Cc: [email-masked]
Date: Wed, 2 Aug 2023 06:53:54 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Thanks for reporting that; I installed the attached.

From 93e30466ff6eec8a2cd66374e199017763821478 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Wed, 2 Aug 2023 06:47:13 -0700
Subject: [PATCH] pinky: fix "d" typo

Problem reported by Bruno Haible (bug#65003).
* src/pinky.c (idle_string): Fix recently-introduced typo:
missing "d" for "days".
---
 src/pinky.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pinky.c b/src/pinky.c
index 381e753b6..b6d411c85 100644
--- a/src/pinky.c
+++ b/src/pinky.c
@@ -147,7 +147,7 @@ static char const *
 idle_string (time_t when)
 {
   static time_t now = 0;
-  static char buf[INT_STRLEN_BOUND (intmax_t) + 2];
+  static char buf[INT_STRLEN_BOUND (intmax_t) + sizeof "d"];
   time_t seconds_idle;
 
   if (now == 0)
@@ -165,7 +165,7 @@ idle_string (time_t when)
   else
     {
       intmax_t days = seconds_idle / (24 * 60 * 60);
-      sprintf (buf, "%"PRIdMAX, days);
+      sprintf (buf, "%"PRIdMAX"d", days);
     }
   return buf;
 }
-- 
2.39.2

Subject: pinky's "Idle" column lost the unit
From: Bruno Haible <[email-masked]>
To: [email-masked]
Date: Wed, 02 Aug 2023 01:45:29 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Paul,

Two days ago, 'pinky's output looked like this:

Login     TTY      Idle   When            
bruno    ?seat0    ?????  2023-07-30 11:25
bruno     tty2     2d     2023-07-30 11:25
...

Today, it looks like this:

Login     TTY      Idle   When            
bruno    ?seat0    ?????  2023-07-30 11:25
bruno     tty2     2      2023-07-30 11:25
...

In the Idle column, the "d" (which stands for days) is gone.

This is a regression. Looks like it was caused by commit
0b2796750ff68eb58616655236d7003f6d30223a , today.

Bruno