Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date module is limited to 63 chars #744

Closed
Lemmmy opened this issue Sep 12, 2017 · 2 comments · Fixed by #745
Closed

Date module is limited to 63 chars #744

Lemmmy opened this issue Sep 12, 2017 · 2 comments · Fixed by #745
Assignees
Labels

Comments

@Lemmmy
Copy link

Lemmmy commented Sep 12, 2017

The string date = AAAAAAAAAABBBBBBBBBBCCCCCCCCCCDDDDDDDDDDEEEEEEEEEEFFFFFFFFFFGGGGGGGGGGHHHHHHHHHHIIIIIIIIII renders AAAAAAAAAABBBBBBBBBBCCCCCCCCCCDDDDDDDDDDEEEEEEEEEEFFFFFFFFFFGGG - this does not seem to be a limitation of date, as running date +AAAAAAAAAABBBBBBBBBBCCCCCCCCCCDDDDDDDDDDEEEEEEEEEEFFFFFFFFFFGGGGGGGGGGHHHHHHHHHHIIIIIIIIII outputs the exact input string.

This prevents me from using a date string like %Y%%{F#5c6370}-%%{F-}%m%%{F#5c6370}-%%{F-}%d %H%%{F#5c6370}:%%{F-}%M%%{F#5c6370}:%%{F-}%S.

@Lemmmy
Copy link
Author

Lemmmy commented Sep 12, 2017

Culprit code seems to be at modules/date.cpp#L45

@patrick96 patrick96 self-assigned this Sep 12, 2017
@patrick96 patrick96 added the bug label Sep 12, 2017
@patrick96
Copy link
Member

I don't see a sensible way to make strftime work with an arbitrary date or time string. The solutions I've found are just increasing the buffer size until strftime stops returning zero.
I'll open a PR that just takes the length of the date string, multiplies it by 10, clamps that value between 64 and 1024 and uses it as the length of the buffer.

patrick96 added a commit to patrick96/polybar that referenced this issue Sep 12, 2017
Sensible upper limit of 1024 chars since anything of that length will
not be fully rendered on the bar anyways.

fixes polybar#744
patrick96 added a commit to patrick96/polybar that referenced this issue Sep 15, 2017
patrick96 added a commit to patrick96/polybar that referenced this issue Sep 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants