Commits

Anonymous committed 889aa69

fix for compiling Mutt with clang: check for wchar_h prior to wctype_h in check for wc funcs

  • Participants
  • Parent commits 844174e
  • Branches HEAD

Comments (0)

Files changed (2)

 #define _XOPEN_SOURCE 1
 #include <stddef.h>
 #include <stdlib.h>
+#ifdef HAVE_WCHAR_H
+#include <wchar.h>
+#endif
 #ifdef HAVE_WCTYPE_H
 #include <wctype.h>
-#endif
-#ifdef HAVE_WCHAR_H
-#include <wchar.h>
 #endif],
                         [mbrtowc(0, 0, 0, 0); wctomb(0, 0); wcwidth(0);
         iswprint(0); iswspace(0); towlower(0); towupper(0); iswalnum(0)],
 
     if (b->parameter)
       mutt_free_parameter (&b->parameter);
-    if (b->unlink && b->filename)
+    if (b->filename)
     {
-      dprint (1, (debugfile, "mutt_free_body: Unlinking %s.\n", b->filename));
-      unlink (b->filename);
+      if (b->unlink)
+	unlink (b->filename);
+      dprint (1, (debugfile, "mutt_free_body: %sunlinking %s.\n",
+	    b->unlink ? "" : "not ", b->filename));
     }
-    else if (b->filename) 
-      dprint (1, (debugfile, "mutt_free_body: Not unlinking %s.\n", b->filename));
 
     FREE (&b->filename);
     FREE (&b->content);