Add support for '+' in custom format specifiers
This commit is contained in:
@@ -93,6 +93,7 @@ static int custom_print(FILE *stream, const struct printf_info *info,
|
|||||||
};
|
};
|
||||||
|
|
||||||
spec.hash = info->alt;
|
spec.hash = info->alt;
|
||||||
|
spec.plus = info->showsign;
|
||||||
spec.minus = info->left;
|
spec.minus = info->left;
|
||||||
spec.width = info->width;
|
spec.width = info->width;
|
||||||
|
|
||||||
@@ -164,6 +165,7 @@ static int custom_fmt_cb(Vstr_base *base, size_t pos, Vstr_fmt_spec *fmt_spec)
|
|||||||
}
|
}
|
||||||
|
|
||||||
spec.hash = fmt_spec->fmt_hash;
|
spec.hash = fmt_spec->fmt_hash;
|
||||||
|
spec.plus = fmt_spec->fmt_plus;
|
||||||
spec.minus = fmt_spec->fmt_minus;
|
spec.minus = fmt_spec->fmt_minus;
|
||||||
spec.width = fmt_spec->fmt_field_width;
|
spec.width = fmt_spec->fmt_field_width;
|
||||||
|
|
||||||
|
|||||||
@@ -162,6 +162,11 @@ struct printf_hook_spec_t {
|
|||||||
*/
|
*/
|
||||||
int minus;
|
int minus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TRUE if a '+' was used in the format specifier
|
||||||
|
*/
|
||||||
|
int plus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The width as given in the format specifier.
|
* The width as given in the format specifier.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user