mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:08:10 +00:00
AK: Properly parse unimplemented format length specifiers
This keeps us from stopping early and not rendering the argument at all.
This commit is contained in:
parent
b4eb21db4d
commit
dd71754d10
1 changed files with 21 additions and 3 deletions
|
@ -318,8 +318,12 @@ struct ModifierState {
|
||||||
unsigned field_width { 0 };
|
unsigned field_width { 0 };
|
||||||
bool has_precision { false };
|
bool has_precision { false };
|
||||||
unsigned precision { 6 };
|
unsigned precision { 6 };
|
||||||
|
unsigned short_qualifiers { 0 }; // TODO: Unimplemented.
|
||||||
unsigned long_qualifiers { 0 };
|
unsigned long_qualifiers { 0 };
|
||||||
bool size_qualifier { false };
|
bool intmax_qualifier { false }; // TODO: Unimplemented.
|
||||||
|
bool ptrdiff_qualifier { false }; // TODO: Unimplemented.
|
||||||
|
bool long_double_qualifier { false }; // TODO: Unimplemented.
|
||||||
|
bool size_qualifier { false }; // TODO: Unimplemented.
|
||||||
bool alternate_form { 0 };
|
bool alternate_form { 0 };
|
||||||
bool always_sign { false };
|
bool always_sign { false };
|
||||||
};
|
};
|
||||||
|
@ -499,14 +503,28 @@ ALWAYS_INLINE int printf_internal(PutChFunc putch, IdentityType<CharType>* buffe
|
||||||
if (*(p + 1))
|
if (*(p + 1))
|
||||||
goto one_more;
|
goto one_more;
|
||||||
}
|
}
|
||||||
|
if (*p == 'h') {
|
||||||
|
++state.short_qualifiers;
|
||||||
|
if (*(p + 1))
|
||||||
|
goto one_more;
|
||||||
|
}
|
||||||
if (*p == 'l') {
|
if (*p == 'l') {
|
||||||
++state.long_qualifiers;
|
++state.long_qualifiers;
|
||||||
if (*(p + 1))
|
if (*(p + 1))
|
||||||
goto one_more;
|
goto one_more;
|
||||||
}
|
}
|
||||||
|
if (*p == 'j') {
|
||||||
|
state.intmax_qualifier = true;
|
||||||
|
if (*(p + 1))
|
||||||
|
goto one_more;
|
||||||
|
}
|
||||||
|
if (*p == 't') {
|
||||||
|
state.ptrdiff_qualifier = true;
|
||||||
|
if (*(p + 1))
|
||||||
|
goto one_more;
|
||||||
|
}
|
||||||
if (*p == 'L') {
|
if (*p == 'L') {
|
||||||
// TODO: Implement this properly.
|
state.long_double_qualifier = true;
|
||||||
// For now just swallow, so the contents are actually rendered.
|
|
||||||
if (*(p + 1))
|
if (*(p + 1))
|
||||||
goto one_more;
|
goto one_more;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue