lot of restructurations. work in progress, *but* it does not seems to
[apps/madmutt.git] / rfc822.c
index f0d9b00..30f1379 100644 (file)
--- a/rfc822.c
+++ b/rfc822.c
@@ -165,7 +165,7 @@ static const char *parse_mailboxdomain (const char *s, const char *nonspecial,
   const char *ps;
 
   while (*s) {
-    SKIPWS (s);
+    s = vskipspaces(s);
     if (strchr (nonspecial, *s) == NULL && is_special (*s))
       return s;
 
@@ -224,7 +224,7 @@ static const char *parse_route_addr (const char *s,
   char token[STRING];
   size_t tokenlen = 0;
 
-  SKIPWS (s);
+  s = vskipspaces(s);
 
   /* find the end of the route */
   if (*s == '@') {
@@ -313,8 +313,7 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS * top, const char *s)
 
   ws_pending = isspace ((unsigned char) *s);
 
-  SKIPWS (s);
-  begin = s;
+  begin = s = vskipspaces(s);
   while (*s) {
     if (*s == ',') {
       if (phraselen) {
@@ -330,8 +329,7 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS * top, const char *s)
       commentlen = 0;
       phraselen = 0;
       s++;
-      begin = s;
-      SKIPWS (begin);
+      begin = vskipspaces(s);
     }
     else if (*s == '(') {
       if (commentlen && commentlen < sizeof (comment) - 1)
@@ -359,8 +357,7 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS * top, const char *s)
       phraselen = 0;
       commentlen = 0;
       s++;
-      begin = s;
-      SKIPWS (begin);
+      begin = vskipspaces(s);
     }
     else if (*s == ';') {
       if (phraselen) {
@@ -383,8 +380,7 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS * top, const char *s)
       phraselen = 0;
       commentlen = 0;
       s++;
-      begin = s;
-      SKIPWS (begin);
+      begin = vskipspaces(s);
     }
     else if (*s == '<') {
       terminate_buffer (phrase, phraselen);
@@ -425,7 +421,7 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS * top, const char *s)
       s = ps;
     }
     ws_pending = isspace ((unsigned char) *s);
-    SKIPWS (s);
+    s = vskipspaces(s);
   }
 
   if (phraselen) {
@@ -473,10 +469,10 @@ rfc822_cat (char *buf, size_t buflen, const char *value, const char *specials)
     }
     *pc++ = '"';
     *pc = 0;
-    strfcpy (buf, tmp, buflen);
+    m_strcpy(buf, buflen, tmp);
   }
   else
-    strfcpy (buf, value, buflen);
+    m_strcpy(buf, buflen, value);
 }
 
 void rfc822_write_address_single (char *buf, size_t buflen, ADDRESS * addr,
@@ -517,7 +513,7 @@ void rfc822_write_address_single (char *buf, size_t buflen, ADDRESS * addr,
     else {
       if (!buflen)
         goto done;
-      strfcpy (pbuf, addr->personal, buflen);
+      m_strcpy(pbuf, buflen, addr->personal);
       len = m_strlen(pbuf);
       pbuf += len;
       buflen -= len;
@@ -540,11 +536,11 @@ void rfc822_write_address_single (char *buf, size_t buflen, ADDRESS * addr,
     if (!buflen)
       goto done;
     if (ascii_strcmp (addr->mailbox, "@") && !display) {
-      strfcpy (pbuf, addr->mailbox, buflen);
+      m_strcpy(pbuf, buflen, addr->mailbox);
       len = m_strlen(pbuf);
     }
     else if (ascii_strcmp (addr->mailbox, "@") && display) {
-      strfcpy (pbuf, mutt_addr_for_display (addr), buflen);
+      m_strcpy(pbuf, buflen, mutt_addr_for_display(addr));
       len = m_strlen(pbuf);
     }
     else {