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

From: "Basil L. Contovounesios" <[email-masked]>
Date: Sat, 16 Mar 2024 11:35:16 +0100

Adam Porter [2024-03-15 21:28 -0500] wrote:

> 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.

In this format string, 15 is the 'width' (which controls padding), not
the 'precision' (which controls truncation).

To truncate beyond 15 without padding, specify a precision instead of a
width: "%>.15t".

So I'm not sure there's a bug here, or at least not the one you
describe.

What's not clear in the documentation is what happens when one specifies
< or > without an explicit precision, as in the example you give.  I'm
guessing this was the source of confusion here.  But I think this can be
addressed as a docfix.  Or am I missing something?

Thanks,
-- 
Basil