move rfc822.c as well
[apps/madmutt.git] / rfc2047.c
index 9ac1cd7..a181e9d 100644 (file)
--- a/rfc2047.c
+++ b/rfc2047.c
@@ -16,8 +16,9 @@
 #include <lib-lib/str.h>
 #include <lib-lib/ascii.h>
 
+#include <lib-mime/mime.h>
+
 #include "mutt.h"
-#include "mime.h"
 #include "charset.h"
 #include "rfc2047.h"
 #include "thread.h"
@@ -45,8 +46,6 @@
 
 #define CONTINUATION_BYTE(c) (((c) & 0xc0) == 0x80)
 
-extern char RFC822Specials[];
-
 typedef size_t (*encoder_t) (char *, const char *, size_t,
                              const char *);
 
@@ -582,9 +581,7 @@ static int rfc2047_decode_word (char *d, const char *s, size_t len)
         for (; pp < pp1; pp++) {
           if (*pp == '_')
             *pd++ = ' ';
-          else if (*pp == '=' &&
-                   (!(pp[1] & ~127) && hexval (pp[1]) != -1) &&
-                   (!(pp[2] & ~127) && hexval (pp[2]) != -1)) {
+          else if (*pp == '=' && hexval(pp[1]) >= 0 && hexval(pp[2]) >= 0) {
             *pd++ = (hexval (pp[1]) << 4) | hexval (pp[2]);
             pp += 2;
           }