GNU bug report logs - #69822
[PATCH] format-spec pads when it should only truncate

Previous Next

Package: emacs;

Reported by: Adam Porter <adam <at> alphapapa.net>

Date: Sat, 16 Mar 2024 02:30:02 UTC

Severity: normal

Tags: patch

Done: Adam Porter <adam <at> alphapapa.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Adam Porter <adam <at> alphapapa.net>
Subject: bug#69822: closed (Re: bug#69822: [PATCH] format-spec pads when
 it should only truncate)
Date: Sat, 23 Mar 2024 14:00:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#69822: [PATCH] format-spec pads when it should only truncate

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

The explanation is attached below, along with your original report.
If you require more details, please reply to 69822 <at> debbugs.gnu.org.

-- 
69822: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69822
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Adam Porter <adam <at> alphapapa.net>
To: "Basil L. Contovounesios" <basil <at> contovou.net>
Cc: 69822-done <at> debbugs.gnu.org
Subject: Re: bug#69822: [PATCH] format-spec pads when it should only truncate
Date: Sat, 23 Mar 2024 08:59:06 -0500
On 3/21/24 06:03, Basil L. Contovounesios wrote:
> Adam Porter [2024-03-21 05:47 -0500] wrote:
> 
>> I'm happy for it to be closed.  (Can the reporter do that, or does
>> it have to be a maintainer?  I can't remember, and the tracker's Web pages don't
>> seem to say for certain.)
> 
> Anyone can close it.  The easiest way is to change the To/Cc address
> from 69822 <at> debbugs.gnu.org to 69822-done <at> debbugs.gnu.org.

Thanks, Basil.  Closing...

[Message part 3 (message/rfc822, inline)]
From: Adam Porter <adam <at> alphapapa.net>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] format-spec pads when it should only truncate
Date: Fri, 15 Mar 2024 21:28:15 -0500
[Message part 4 (text/plain, inline)]
Hi,

Please see the attached patch which fixes a bug in `format-spec': that a 
format spec like "%>15t", which is intended to limit the width of a 
string to 15 characters, would also pad a string less than that length 
to be that length.

Please note the test case which the patch essentially disables: it calls 
one of the intermediate functions with arguments which I'm not sure it 
would be called with in real usage.  I added two test cases to cover the 
behavior which the patch is intended to fix, and after editing the 
`format-spec--do-flags' to pass the new cases, only that one case 
failed; so, since I'm not sure whether it indicates an actual bug, I 
disabled it.

Perhaps there exists a real-world scenario to which that test would 
apply, but such is not encoded as an end-to-end test of `format-spec' 
with a spec string, so it's hard to say.

In other words, this patch fixes a real bug and adds test cases for it. 
It also causes an existing case to fail, but since I'm not sure whether 
that represents a real bug, that case is now disabled.

All other tests in the file still pass.

Thanks,
Adam
[0001-format-spec-do-flags-Don-t-pad-when-just-truncating.patch (text/x-patch, attachment)]

This bug report was last modified 1 year and 109 days ago.

Previous Next


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