projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From: David Champion <dgc@uchicago.edu>
[apps/madmutt.git]
/
url.c
diff --git
a/url.c
b/url.c
index
3d7a333
..
78d03d8
100644
(file)
--- a/
url.c
+++ b/
url.c
@@
-16,11
+16,14
@@
#endif
#include "mutt.h"
#endif
#include "mutt.h"
+#include "ascii.h"
#include "mapping.h"
#include "url.h"
#include "mime.h"
#include "mapping.h"
#include "url.h"
#include "mime.h"
+#include "lib/mem.h"
+
#include <ctype.h>
static struct mapping_t UrlMap[] = {
#include <ctype.h>
static struct mapping_t UrlMap[] = {
@@
-169,8
+172,8
@@
int url_ciss_tostring (ciss_url_t * ciss, char *dest, size_t len, int flags)
snprintf (dest, len, "%s:", mutt_getnamebyvalue (ciss->scheme, UrlMap));
if (ciss->host) {
snprintf (dest, len, "%s:", mutt_getnamebyvalue (ciss->scheme, UrlMap));
if (ciss->host) {
- s
afe_str
cat (dest, len, "//");
- len -= (l = strlen (dest));
+ s
tr_
cat (dest, len, "//");
+ len -= (l = str
_
len (dest));
dest += l;
if (ciss->user) {
dest += l;
if (ciss->user) {
@@
-179,7
+182,7
@@
int url_ciss_tostring (ciss_url_t * ciss, char *dest, size_t len, int flags)
else
snprintf (dest, len, "%s@", ciss->user);
else
snprintf (dest, len, "%s@", ciss->user);
- len -= (l = strlen (dest));
+ len -= (l = str
_
len (dest));
dest += l;
}
dest += l;
}
@@
-190,7
+193,7
@@
int url_ciss_tostring (ciss_url_t * ciss, char *dest, size_t len, int flags)
}
if (ciss->path)
}
if (ciss->path)
- s
afe_str
cat (dest, len, ciss->path);
+ s
tr_
cat (dest, len, ciss->path);
return 0;
}
return 0;
}
@@
-210,7
+213,7
@@
int url_parse_mailto (ENVELOPE * e, char **body, const char *src)
if (!(t = strchr (src, ':')))
return -1;
if (!(t = strchr (src, ':')))
return -1;
- if ((tmp = s
afe_str
dup (t + 1)) == NULL)
+ if ((tmp = s
tr_
dup (t + 1)) == NULL)
return -1;
if ((headers = strchr (tmp, '?')))
return -1;
if ((headers = strchr (tmp, '?')))
@@
-232,19
+235,27
@@
int url_parse_mailto (ENVELOPE * e, char **body, const char *src)
if (!ascii_strcasecmp (tag, "body")) {
if (body)
if (!ascii_strcasecmp (tag, "body")) {
if (body)
-
mutt_
str_replace (body, value);
+ str_replace (body, value);
}
else {
}
else {
- taglen = strlen (tag);
+#define SAFEPFX (option (OPTSTRICTMAILTO) ? "" : "X-Mailto-")
+ taglen = str_len (tag) + str_len (SAFEPFX);
/* mutt_parse_rfc822_line makes some assumptions */
/* mutt_parse_rfc822_line makes some assumptions */
- snprintf (scratch, sizeof (scratch), "%s: %s", tag, value);
+ snprintf (scratch, sizeof (scratch), "%s%s: %s", SAFEPFX, tag, value);
+#undef SAVEPFX
scratch[taglen] = '\0';
value = &scratch[taglen + 1];
SKIPWS (value);
mutt_parse_rfc822_line (e, NULL, scratch, value, 1, 0, 0, &last);
scratch[taglen] = '\0';
value = &scratch[taglen + 1];
SKIPWS (value);
mutt_parse_rfc822_line (e, NULL, scratch, value, 1, 0, 0, &last);
+ /* if $strict_mailto is set, force editing headers to let
+ * users have a look at what we got */
+ if (!option (OPTSTRICTMAILTO)) {
+ set_option (OPTXMAILTO);
+ set_option (OPTEDITHDRS);
+ }
}
}
}
}
-
FREE
(&tmp);
+
mem_free
(&tmp);
return 0;
}
return 0;
}