workaround a stupid issue in how decoding is performed in mutt *sigh*
[apps/madmutt.git] / lib-mime / rfc3676.c
index 0ca9ff7..3caa76f 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <utime.h>
 
-#include <lib-ui/curses.h>
+#include <lib-ui/lib-ui.h>
 
 #include "state.h"
 #include "rfc3676.h"
@@ -42,15 +42,12 @@ static void print_flowed_line (char *line, STATE * s, int ql) {
       width = MaxLineLength;
   }
   else {
-    if (option (OPTMBOXPANE))
-      width = COLS - SidebarWidth - WrapMargin - ql - 1;
-    else
-      width = COLS - WrapMargin - ql - 1;
+    width = getmaxx(main_w) - WrapMargin - ql - 1;
 
     if (!(s->flags & M_REPLYING) && option (OPTSTUFFQUOTED))
       --width;
     if (width < 0)
-      width = COLS;
+      width = getmaxx(main_w);
   }
 
   if (m_strlen(line) == 0) {
@@ -225,7 +222,7 @@ void rfc3676_space_stuff (HEADER* hdr) {
   if ((in = safe_fopen (hdr->content->filename, "r")) == NULL)
     return;
 
-  out = m_tempfile(tmpf, sizeof(tmpf), NONULL(MCore.tmpdir), NULL);
+  out = m_tempfile(tmpf, sizeof(tmpf), NONULL(mod_core.tmpdir), NULL);
   if (!out) {
     m_fclose(&in);
     return;