You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sidebar-delimnullwide.patch 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From: Evgeni Golov <sargentd@die-welt.net>
  2. Date: Wed, 5 Mar 2014 17:46:07 +0100
  3. Subject: sidebar-delimnullwide
  4. SidebarDelim can be NULL and strlen(NULL) is a bad idea, as it will segfault.
  5. Wrap it with NONULL().
  6. While at it, change strlen to mbstowcs for better utf8 support.
  7. Closes: #696145, #663883
  8. Gbp-Pq: Topic mutt-patched
  9. ---
  10. sidebar.c | 4 ++--
  11. 1 file changed, 2 insertions(+), 2 deletions(-)
  12. diff --git a/sidebar.c b/sidebar.c
  13. index 51a25ca..c3ea338 100644
  14. --- a/sidebar.c
  15. +++ b/sidebar.c
  16. @@ -88,7 +88,7 @@ char *make_sidebar_entry(char *box, int size, int new, int flagged)
  17. int box_len, box_bytes;
  18. int int_len;
  19. int right_offset = 0;
  20. - int delim_len = strlen(SidebarDelim);
  21. + int delim_len = mbstowcs(NULL, NONULL(SidebarDelim), 0);
  22. static char *entry;
  23. right_width = left_width = 0;
  24. @@ -178,7 +178,7 @@ int draw_sidebar(int menu) {
  25. #ifndef USE_SLANG_CURSES
  26. attr_t attrs;
  27. #endif
  28. - short delim_len = strlen(SidebarDelim);
  29. + short delim_len = mbstowcs(NULL, NONULL(SidebarDelim), 0);
  30. short color_pair;
  31. static bool initialized = false;