Garbled lines in inbox #58

Closed
mrschyte opened this Issue Dec 20, 2013 · 6 comments

Projects

None yet

3 participants

@mrschyte

Certain messages get a garbled line in the mailbox if the terminal window is small enough.

@karelzak
Owner

On Fri, Dec 20, 2013 at 01:07:55AM -0800, Peter Kasza wrote:

Certain messages get a garbled line in the mailbox if the terminal window is small enough.

And your index_format setting?

Karel

Karel Zak kzak@redhat.com
http://karelzak.blogspot.com

@mrschyte

set index_format = "%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s %* [%g]"

@mrschyte

It seems to me that the %* padding is calculating the length of the %g tags wrong. Without it everything displays fine, even on a smaller terminal.

@duckdalbe

Same problem here, I also found the "soft-padding" to be the culprit: when the line would need to be shortened it'll disappear until the window is made broad enough to display the whole line unabridged.

@karelzak
Owner

Yep, there is very probably problem with mutt_wstr_trunc() where the code incorrectly compares unsigned and signed numbers. I'm going to fix it next week,

@karelzak karelzak added a commit that referenced this issue Dec 22, 2013
@karelzak sidebar: fix %* index_format
 * mutt_FormatString() does not use SidebarWidth when calculate
   right part of the %*

 * mutt_wstr_trunc() does not reset mbrtowc() after error

 * mutt_wstr_trunc() compare signed and unsigned numbers to check for
   maxlen and maxwid limits and does not care about unprintable chars

Addresses: #58
Signed-off-by: Karel Zak <kzak@redhat.com>
2f3e0f7
@karelzak karelzak closed this Dec 22, 2013
@flatcap flatcap pushed a commit to neomutt/neomutt that referenced this issue Mar 23, 2016
@karelzak Improve error handling in mutt_wstr_trunc().
This is Karel Zak's patch to fix handling of (illegal) multi-byte chars.

 * mutt_wstr_trunc():
 Reset mbstate after error in mbrtowc().
 Set wc=0 if wcwidth returns < 0.

Addresses: karelzak/mutt-kz#58

Thanks to Richard Russon for bringing this patch to our attention.
337b98b
@aschrab aschrab pushed a commit to aschrab/mutt that referenced this issue Apr 7, 2016
@karelzak Improve error handling in mutt_wstr_trunc().
This is Karel Zak's patch to fix handling of (illegal) multi-byte chars.

 * mutt_wstr_trunc():
 Reset mbstate after error in mbrtowc().
 Set wc=0 if wcwidth returns < 0.

Addresses: karelzak/mutt-kz#58

Thanks to Richard Russon for bringing this patch to our attention.
f314b82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment