Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
It seems that
format_time
oftztime
doesn't works correctly after v2.14.If the configuration is written as follows, the string expected to be printed is
"<span foreground='#ee9a00'>21-11-14 (Sun) 02:27:51</span>"
but I got"%y-%m-%d (%a) %H:%M:%S"
.The detailed behavior of
format_time
is described in the doc: https://i3wm.org/docs/i3status.html#_tztimeCause
The cause is that
format
is not correctly used.format
should be used when printing butformat_time
is used in v2.14.The source code of the previous version v2.13 uses
format
.https://github.com/i3/i3status/blame/101215bbc83b97de30b6b535bbe2e93d2e913804/src/print_time.c#L68-L77
This pull request fixes it.
Workaround
You can use
%
informat
directly.Another issue
maybe_escape_markup
was used in previous versions to sanitize date-time string formatted withformat_time
,https://github.com/i3/i3status/blame/101215bbc83b97de30b6b535bbe2e93d2e913804/src/print_time.c#L74
Although, it doesn't care about the length of the buffer, I think it can lead to buffer overflow.
It seems that
maybe_escape_markup
is not used in the current implementation.In other words, the current behavior is the same as if
format_time
was not used andstrftime
format was used informat
.I want to keep it as is and I think it is better to be fixed in the another pull request because I think it's rare that the output text is long, so I don't think it's a big problem as it is.