#include <lib-lib/ascii.h>
#include <lib-lib/str.h>
#include <lib-lib/macros.h>
+#include <lib-lib/file.h>
#include <lib-lib/buffer.h>
+#include <lib-lib/mapping.h>
+
+#include <lib-mime/mime.h>
#include "mutt.h"
#include "handler.h"
#include "enter.h"
#include "mx.h"
-#include "mapping.h"
#include "keymap.h"
#include "copy.h"
-#include "mime.h"
#ifdef USE_IMAP
if (skip_quote && *tmp == '"')
tmp++;
- SKIPWS (tmp);
- s->dptr = tmp;
+ s->dptr = vskipspaces(tmp);
return 0;
}
const char *pt;
char ch = *pc++;
- SKIPWS (pc);
+ pc = vskipspaces(pc);
switch (ch) {
case '-':
{
default:
flag |= M_PDR_ERRORDONE;
}
- SKIPWS (pc);
+ pc = vskipspaces(pc);
}
if ((flag & M_PDR_ERROR) && !(flag & M_PDR_ABSOLUTE)) { /* getDate has its own error message, don't overwrite it here */
snprintf (err->data, err->dsize, _("Invalid relative date: %s"), pc - 1);
p_clear(&buffer, 1);
if (mutt_extract_token (&buffer, s, M_TOKEN_COMMENT | M_TOKEN_PATTERN) != 0
|| !buffer.data) {
- strfcpy (err->data, _("error in expression"), err->dsize);
+ m_strcpy(err->data, err->dsize, _("error in expression"));
return (-1);
}
return (-1);
}
haveMin = TRUE;
- SKIPWS (pc);
+ pc = vskipspaces(pc);
if (*pc == '-') {
- const char *pt = pc + 1;
+ const char *pt;
- SKIPWS (pt);
+ pt = skipspaces(pc + 1);
untilNow = (*pt == '\0');
}
}
ps.dsize = m_strlen(s);
while (*ps.dptr) {
- SKIPWS (ps.dptr);
+ ps.dptr = vskipspaces(ps.dptr);
switch (*ps.dptr) {
case '^':
ps.dptr++;
}
tmp->op = entry->op;
- ps.dptr++; /* eat the operator and any optional whitespace */
- SKIPWS (ps.dptr);
+ ps.dptr = vskipspaces(ps.dptr + 1);
if (entry->eat_arg) {
if (!*ps.dptr) {
}
}
if (!curlist) {
- strfcpy (err->data, _("empty pattern"), err->dsize);
+ m_strcpy(err->data, err->dsize, _("empty pattern"));
return NULL;
}
if (curlist->next) {
int n, ...)
{
va_list ap;
- ADDRESS *a;
+ address_t *a;
va_start (ap, n);
for (; n; n--) {
- for (a = va_arg (ap, ADDRESS *); a; a = a->next) {
+ for (a = va_arg (ap, address_t *); a; a = a->next) {
if (pat->alladdr ^
((a->mailbox && patmatch (pat, a->mailbox) == 0) ||
(match_personal && a->personal &&
return 0;
}
-int mutt_is_list_recipient (int alladdr, ADDRESS * a1, ADDRESS * a2)
+int mutt_is_list_recipient (int alladdr, address_t * a1, address_t * a2)
{
for (; a1; a1 = a1->next)
if (alladdr ^ mutt_is_subscribed_list (a1))
return alladdr;
}
-int mutt_is_list_cc (int alladdr, ADDRESS * a1, ADDRESS * a2)
+int mutt_is_list_cc (int alladdr, address_t * a1, address_t * a2)
{
for (; a1; a1 = a1->next)
if (alladdr ^ mutt_is_mail_list (a1))
return alladdr;
}
-static int match_user (int alladdr, ADDRESS * a1, ADDRESS * a2)
+static int match_user (int alladdr, address_t * a1, address_t * a2)
{
for (; a1; a1 = a1->next)
if (alladdr ^ mutt_addr_is_user (a1))
if (!strchr (s, '~') && !strchr (s, '=')) { /* yup, so spoof a real request */
/* convert old tokens into the new format */
if (ascii_strcasecmp ("all", s) == 0 || !m_strcmp("^", s) || !m_strcmp(".", s)) /* ~A is more efficient */
- strfcpy (s, "~A", len);
+ m_strcpy(s, len, "~A");
else if (ascii_strcasecmp ("del", s) == 0)
- strfcpy (s, "~D", len);
+ m_strcpy(s, len, "~D");
else if (ascii_strcasecmp ("flag", s) == 0)
- strfcpy (s, "~F", len);
+ m_strcpy(s, len, "~F");
else if (ascii_strcasecmp ("new", s) == 0)
- strfcpy (s, "~N", len);
+ m_strcpy(s, len, "~N");
else if (ascii_strcasecmp ("old", s) == 0)
- strfcpy (s, "~O", len);
+ m_strcpy(s, len, "~O");
else if (ascii_strcasecmp ("repl", s) == 0)
- strfcpy (s, "~Q", len);
+ m_strcpy(s, len, "~Q");
else if (ascii_strcasecmp ("read", s) == 0)
- strfcpy (s, "~R", len);
+ m_strcpy(s, len, "~R");
else if (ascii_strcasecmp ("tag", s) == 0)
- strfcpy (s, "~T", len);
+ m_strcpy(s, len, "~T");
else if (ascii_strcasecmp ("unread", s) == 0)
- strfcpy (s, "~U", len);
+ m_strcpy(s, len, "~U");
else {
quote_simple (tmp, sizeof (tmp), s);
mutt_expand_fmt (s, len, simple, tmp);
BUFFER err;
int i;
- strfcpy (buf, NONULL (Context->pattern), sizeof (buf));
+ m_strcpy(buf, sizeof(buf), NONULL(Context->pattern));
if (prompt || op != M_LIMIT)
if (mutt_get_field (prompt, buf, sizeof (buf), M_PATTERN | M_CLEAR) != 0 || !buf[0])
return (-1);
}
/* record new limit pattern, unless match all */
- if (str_ncmp (buf, "~A", 2) != 0) {
+ if (m_strncmp(buf, "~A", 2) != 0) {
Context->pattern = simple;
simple = NULL; /* don't clobber it */
Context->limit_pattern = mutt_pattern_comp (buf, M_FULL_MSG, &err);
HEADER *h;
if (op != OP_SEARCH_NEXT && op != OP_SEARCH_OPPOSITE) {
- strfcpy (buf, LastSearch, sizeof (buf));
+ m_strcpy(buf, sizeof(buf), LastSearch);
if (mutt_get_field ((op == OP_SEARCH) ? _("Search for: ") :
_("Reverse search for: "), buf, sizeof (buf),
M_CLEAR | M_PATTERN) != 0 || !buf[0])
/* compare the *expanded* version of the search pattern in case
$simple_search has changed while we were searching */
- strfcpy (temp, buf, sizeof (temp));
+ m_strcpy(temp, sizeof(temp), buf);
mutt_check_simple (temp, sizeof (temp), NONULL (SimpleSearch));
if (!SearchPattern || m_strcmp(temp, LastSearchExpn)) {
set_option (OPTSEARCHINVALID);
- strfcpy (LastSearch, buf, sizeof (LastSearch));
+ m_strcpy(LastSearch, sizeof(LastSearch), buf);
mutt_message _("Compiling search pattern...");
mutt_pattern_free (&SearchPattern);