Cleanup PyUnicode_FromFormatV() for zero padding
Skip the "0" instead of parsing it twice: detect zero padding and then parsed as a digit of the width.
This commit is contained in:
parent
15a1136547
commit
4c63a972d1
|
@ -2349,7 +2349,11 @@ unicode_fromformat_arg(_PyUnicodeWriter *writer,
|
||||||
|
|
||||||
p = f;
|
p = f;
|
||||||
f++;
|
f++;
|
||||||
zeropad = (*f == '0');
|
zeropad = 0;
|
||||||
|
if (*f == '0') {
|
||||||
|
zeropad = 1;
|
||||||
|
f++;
|
||||||
|
}
|
||||||
|
|
||||||
/* parse the width.precision part, e.g. "%2.5s" => width=2, precision=5 */
|
/* parse the width.precision part, e.g. "%2.5s" => width=2, precision=5 */
|
||||||
width = 0;
|
width = 0;
|
||||||
|
|
Loading…
Reference in New Issue