mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
printf: Support dynamic fill widths
The printf formatting mini-language actually allows you to pass a '*' character in place of the fill width specification, in which case it eats one of the passed in arguments and uses it as width, so implement that.
This commit is contained in:
parent
cfe8fdd5aa
commit
79f867238a
Notes:
sideshowbarker
2024-07-19 12:47:22 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/79f867238a9 Pull-request: https://github.com/SerenityOS/serenity/pull/423 Reviewed-by: https://github.com/awesomekling
1 changed files with 5 additions and 0 deletions
|
@ -222,6 +222,11 @@ template<typename PutChFunc>
|
||||||
if (*(p + 1))
|
if (*(p + 1))
|
||||||
goto one_more;
|
goto one_more;
|
||||||
}
|
}
|
||||||
|
if (*p == '*') {
|
||||||
|
fieldWidth = va_arg(ap, int);
|
||||||
|
if (*(p + 1))
|
||||||
|
goto one_more;
|
||||||
|
}
|
||||||
if (*p == 'l') {
|
if (*p == 'l') {
|
||||||
++long_qualifiers;
|
++long_qualifiers;
|
||||||
if (*(p + 1))
|
if (*(p + 1))
|
||||||
|
|
Loading…
Reference in a new issue