]> granicus.if.org Git - mutt/commitdiff
Revert URL path encoding for now
authorRocco Rutte <pdmef@gmx.net>
Mon, 29 Jun 2009 16:03:29 +0000 (18:03 +0200)
committerRocco Rutte <pdmef@gmx.net>
Mon, 29 Jun 2009 16:03:29 +0000 (18:03 +0200)
It breaks gmail url display and makes bcache use different paths. Still
we need to think about whether we want to allow any character in bcache
paths (possibly multibyte, possibly depending on $charset).

ChangeLog
url.c
url.h

index 9812d30296de5781ddbabab92c223a010537da3b..494d5d8ccc8aed3e102b893238a5a27d954abee5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-06-28 20:49 -0700  Brendan Cully  <brendan@kublai.com>  (298194c414f0)
+
+       * configure.ac, curs_lib.c: Allow tabs in index subject. Closes #3270.
+
+2009-06-28 20:21 -0700  Brendan Cully  <brendan@kublai.com>  (ecea9568202f)
+
+       * imap/util.c: Allow ImapDelimChars to be unset
+
 2009-06-28 19:21 -0700  Brendan Cully  <brendan@kublai.com>  (ef6523d11f24)
 
        * mutt.h: Rename struct thread to struct mutt_thread. Closes #3279.
diff --git a/url.c b/url.c
index 0f6cbc3bcfd9a04d16df03425a5ae6fc5195d821..b31a94c40510096143141edf911e23ab309973b3 100644 (file)
--- a/url.c
+++ b/url.c
@@ -177,17 +177,7 @@ int url_parse_ciss (ciss_url_t *ciss, char *src)
   return ciss_parse_userhost (ciss, tmp);
 }
 
-static int bad_username (char c)
-{
-  return strchr ("/:%", c) != NULL;
-}
-
-static int bad_path (char c)
-{
-  return (c <= 0x20 || c >= 0x7f || strchr ("\"<>#%{}|\\^~[]`", c)) ? 1 : 0;
-}
-
-static void url_pct_encode (char *dst, size_t l, const char *src, int (*bad) (char))
+static void url_pct_encode (char *dst, size_t l, const char *src)
 {
   static const char *alph = "0123456789ABCDEF";
 
@@ -195,7 +185,7 @@ static void url_pct_encode (char *dst, size_t l, const char *src, int (*bad) (ch
   l--;
   while (src && *src && l)
   {
-    if (bad (*src) && l > 3)
+    if (strchr ("/:%", *src) && l > 3)
     {
       *dst++ = '%';
       *dst++ = alph[(*src >> 4) & 0xf];
@@ -227,12 +217,12 @@ int url_ciss_tostring (ciss_url_t* ciss, char* dest, size_t len, int flags)
     if (ciss->user)
     {
       char u[STRING];
-      url_pct_encode (u, sizeof (u), ciss->user, bad_username);
+      url_pct_encode (u, sizeof (u), ciss->user);
 
       if (flags & U_DECODE_PASSWD && ciss->pass)
       {
        char p[STRING];
-       url_pct_encode (p, sizeof (p), ciss->pass, bad_username);
+       url_pct_encode (p, sizeof (p), ciss->pass);
        snprintf (dest, len, "%s:%s@", u, p);
       }
       else
@@ -248,11 +238,7 @@ int url_ciss_tostring (ciss_url_t* ciss, char* dest, size_t len, int flags)
   }
 
   if (ciss->path)
-  {
-    char p[STRING];
-    url_pct_encode (p, sizeof (p), ciss->path, bad_path);
-    safe_strcat (dest, len, p);
-  }
+    safe_strcat (dest, len, ciss->path);
 
   return 0;
 }
@@ -323,9 +309,3 @@ out:
   return rc;
 }
 
-void url_encode_path (char *dest, size_t len, const char *src)
-{
-  len--;
-  url_pct_encode (dest, len, src, bad_path);
-  dest[len] = 0;
-}
diff --git a/url.h b/url.h
index 1d757a55364dff3c89c290f722bc4847deb17e26..926416e743e369510f092d2f9136625eb70c9067 100644 (file)
--- a/url.h
+++ b/url.h
@@ -34,6 +34,5 @@ int url_parse_file (char *d, const char *src, size_t dl);
 int url_parse_ciss (ciss_url_t *ciss, char *src);
 int url_ciss_tostring (ciss_url_t* ciss, char* dest, size_t len, int flags);
 int url_parse_mailto (ENVELOPE *e, char **body, const char *src);
-void url_encode_path (char *dest, size_t len, const char *src);
 
 #endif