projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
drop the builtin so called editor and the mailx feature we really dont
[apps/madmutt.git]
/
lib-mime
/
rfc822.c
diff --git
a/lib-mime/rfc822.c
b/lib-mime/rfc822.c
index
22e54a4
..
9009d40
100644
(file)
--- a/
lib-mime/rfc822.c
+++ b/
lib-mime/rfc822.c
@@
-37,8
+37,6
@@
#include "mutt_idna.h"
#include "mutt_idna.h"
-const char RFC822Specials[] = "@.,:;<>[]\\\"()";
-
void address_wipe(address_t *addr)
{
p_delete(&addr->personal);
void address_wipe(address_t *addr)
{
p_delete(&addr->personal);
@@
-180,7
+178,7
@@
static const char *parse_quote(const char *s, static_buf *buf)
return NULL;
}
return NULL;
}
-#define is_special(x) strchr(RFC822Specials,x)
+const char RFC822Specials[] = "@.,:;<>[]\\\"()";
static const char *next_phrase(const char *s, static_buf *buf)
{
static const char *next_phrase(const char *s, static_buf *buf)
{
@@
-189,13
+187,13
@@
static const char *next_phrase(const char *s, static_buf *buf)
return parse_quote(s + 1, buf);
}
return parse_quote(s + 1, buf);
}
- if (
is_special(
*s)) {
+ if (
strchr(RFC822Specials,
*s)) {
stbuf_append(buf, *s);
return s + 1;
}
while (*s) {
stbuf_append(buf, *s);
return s + 1;
}
while (*s) {
- if (ISSPACE(*s) ||
is_special(
*s))
+ if (ISSPACE(*s) ||
strchr(RFC822Specials,
*s))
break;
stbuf_append(buf, *s++);
}
break;
stbuf_append(buf, *s++);
}
@@
-210,7
+208,7
@@
parse_mailboxdomain(const char *s, const char *nonspecial, static_buf *mbox,
while (*s) {
s = skipspaces(s);
while (*s) {
s = skipspaces(s);
- if (!strchr(nonspecial, *s) &&
is_special(
*s))
+ if (!strchr(nonspecial, *s) &&
strchr(RFC822Specials,
*s))
return s;
if (*s == '(') {
return s;
if (*s == '(') {
@@
-452,22
+450,19
@@
rfc822_write_address(char *buf, ssize_t buflen, address_t *addr, int display)
buf[pos++] = ' ';
}
buf[pos++] = ' ';
}
-
while (addr
) {
+
for (; addr; addr = addr->next
) {
pos += rfc822_write_address_single(buf + pos, buflen + 1 - pos,
addr, display);
pos += rfc822_write_address_single(buf + pos, buflen + 1 - pos,
addr, display);
- /* if there is another address, and its not a group mailbox name or
- group terminator, add a comma to separate the addresses */
+
if (!addr->group && addr->next && addr->next->mailbox) {
if (!addr->group && addr->next && addr->next->mailbox) {
+ /* if there is another address, and its not a group mailbox name or
+ group terminator, add a comma to separate the addresses */
if (pos + 2 >= buflen)
if (pos + 2 >= buflen)
- goto done;
- if (!buflen)
- goto done;
+ break;
buf[pos++] = ',';
buf[pos++] = ' ';
}
buf[pos++] = ',';
buf[pos++] = ' ';
}
-
- addr = addr->next;
}
done:
}
done: