GNU bug report logs - #75849
30.0.93; format-seconds: sometimes broken for negative arguments

Previous Next

Package: emacs;

Reported by: "N. Jackson" <njackson <at> posteo.net>

Date: Sun, 26 Jan 2025 03:14:01 UTC

Severity: normal

Found in version 30.0.93

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: "N. Jackson" <njackson <at> posteo.net>, Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 75849 <at> debbugs.gnu.org
Subject: bug#75849: 30.0.93; format-seconds: sometimes broken for negative arguments
Date: Thu, 30 Jan 2025 14:10:39 +0200
> From: "N. Jackson" <njackson <at> posteo.net>
> Date: Sun, 26 Jan 2025 03:12:47 +0000
> 
> 
> With a negative argument, the function format-seconds sometimes
> gives incorrect results.
> 
> For example:
> 
>   (format-seconds "%dd %hh %mm %ss" -20)  ; => "-1d 23h 59m 40s" (incorrect)
> 
> But it works correctly when the argument is positive and it works
> correctly with the same negative agument but a simpler format
> string:
> 
>   (format-seconds "%dd %hh %mm %ss" 20)   ; => "0d 0h 0m 20s" (correct)
>   (format-seconds "%ss" 20)               ; => "20s" (correct)
>   (format-seconds "%ss" -20)              ; => "-20s" (correct)
> 
> This bug also exists on master.  (I tested just now, after commit
> 35d39278599caf30eb4bfbd83118ffe15d2bc705 of Jan 25 21:18:00 2025
> +0100).

Paul, could you please take a look at this?




This bug report was last modified 159 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.