GNU bug report logs -
#69822
[PATCH] format-spec pads when it should only truncate
Previous Next
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
[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)]
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)]
[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.