reorganize code so that the rfc822parse.c does not needs lib-crypt nor
[apps/madmutt.git] / url.c
diff --git a/url.c b/url.c
index 597fdca..81b47c7 100644 (file)
--- a/url.c
+++ b/url.c
 
 #include <lib-lib/mem.h>
 #include <lib-lib/ascii.h>
+#include <lib-lib/mapping.h>
+
+#include <lib-mime/mime.h>
 
 #include "mutt.h"
-#include "mapping.h"
 #include "url.h"
 
-#include "mime.h"
 
 #include <ctype.h>
 
@@ -49,10 +50,7 @@ static void url_pct_decode (char *s)
     return;
 
   for (d = s; *s; s++) {
-    if (*s == '%' && s[1] && s[2] &&
-        isxdigit ((unsigned char) s[1]) &&
-        isxdigit ((unsigned char) s[2]) &&
-        hexval (s[1]) >= 0 && hexval (s[2]) >= 0) {
+    if (*s == '%' && hexval (s[1]) >= 0 && hexval (s[2]) >= 0) {
       *d++ = (hexval (s[1]) << 4) | (hexval (s[2]));
       s += 2;
     }
@@ -236,7 +234,7 @@ int url_parse_mailto (ENVELOPE * e, char **body, const char *src)
 
     if (!ascii_strcasecmp (tag, "body")) {
       if (body)
-        str_replace (body, value);
+        m_strreplace(body, value);
     }
     else {
 #define SAFEPFX (option (OPTSTRICTMAILTO) ? "" : "X-Mailto-")