#endif
#include "mutt.h"
-#include "mailbox.h"
+#include "mx.h"
#include "mime.h"
#include "rfc2047.h"
#include "rfc2231.h"
#include "lib/intl.h"
#include "lib/str.h"
#include "lib/rx.h"
+#include "lib/debug.h"
#include <string.h>
#include <ctype.h>
return (line);
}
- buf += safe_strlen (buf) - 1;
+ buf += mutt_strlen (buf) - 1;
if (*buf == '\n') {
/* we did get a full line. remove trailing space */
while (ISSPACE (*buf))
new = NULL;
if (*s == '<') {
- n = safe_strlen (s);
+ n = mutt_strlen (s);
if (s[n - 1] != '>') {
o = s;
s = NULL;
new = safe_strdup (s);
}
else if (o) {
- m = safe_strlen (s);
+ m = mutt_strlen (s);
if (s[m - 1] == '>') {
new = safe_malloc (sizeof (char) * (n + m + 1));
strcpy (new, o); /* __STRCPY_CHECKED__ */
const char *p;
size_t i;
- dprint (2, (debugfile, "parse_parameters: `%s'\n", s));
+ debug_print (2, ("`%s'\n", s));
while (*s) {
if ((p = strpbrk (s, "=;")) == NULL) {
- dprint (1,
- (debugfile, "parse_parameters: malformed parameter: %s\n", s));
+ debug_print (1, ("malformed parameter: %s\n", s));
goto bail;
}
new->value = safe_strdup (buffer);
- dprint (2, (debugfile, "parse_parameter: `%s' = `%s'\n",
- new->attribute ? new->attribute : "",
+ debug_print (2, ("`%s' = `%s'\n", new->attribute ? new->attribute : "",
new->value ? new->value : ""));
/* Add this parameter to the list */
head = cur = new;
}
else {
- dprint (1,
- (debugfile, "parse_parameters(): parameter with no value: %s\n",
- s));
+ debug_print (1, ("parameter with no value: %s\n", s));
s = p;
}
c++;
SKIPWS (c);
if (!*c) {
- dprint (1,
- (debugfile,
- "mutt_read_mime_header(): skipping empty header field: %s\n",
- line));
+ debug_print (1, ("skipping empty header field: %s\n", line));
continue;
}
}
else {
- dprint (1,
- (debugfile, "read_mime_header: bogus MIME header: %s\n", line));
+ debug_print (1, ("bogus MIME header: %s\n", line));
break;
}
return (NULL);
}
- blen = safe_strlen (boundary);
+ blen = mutt_strlen (boundary);
while (ftell (fp) < end_off && fgets (buffer, LONG_STRING, fp) != NULL) {
- len = safe_strlen (buffer);
+ len = mutt_strlen (buffer);
crlf = (len > 1 && buffer[len - 2] == '\r') ? 1 : 0;
buffer[i] = 0;
/* Check for the end boundary */
- if (safe_strcmp (buffer + blen + 2, "--") == 0) {
+ if (mutt_strcmp (buffer + blen + 2, "--") == 0) {
final = 1;
break; /* done parsing */
}
else if (sscanf (t, "%d:%d", &hour, &min) == 2)
sec = 0;
else {
- dprint (1,
- (debugfile, "parse_date: could not process time format: %s\n",
- t));
+ debug_print (1, ("could not process time format: %s\n", t));
return (-1);
}
tm.tm_hour = hour;
}
if (count < 4) { /* don't check for missing timezone */
- dprint (1,
- (debugfile,
- "parse_date(): error parsing date format, using received time\n"));
+ debug_print (1, ("error parsing date format, using received time\n"));
return (-1);
}
#ifdef USE_NNTP
else if (!safe_strcasecmp (line + 1, "ollowup-to")) {
if (!e->followup_to) {
- mutt_remove_trailing_ws (p);
- e->followup_to = safe_strdup (mutt_skip_whitespace (p));
+ str_skip_trailws (p);
+ e->followup_to = safe_strdup (str_skip_initws (p));
}
matched = 1;
}
case 'n':
if (!safe_strcasecmp (line + 1, "ewsgroups")) {
FREE (&e->newsgroups);
- mutt_remove_trailing_ws (p);
- e->newsgroups = safe_strdup (mutt_skip_whitespace (p));
+ str_skip_trailws (p);
+ e->newsgroups = safe_strdup (str_skip_initws (p));
matched = 1;
}
break;
/* Keep track of the user-defined headers */
if (!matched && user_hdrs) {
/* restore the original line */
- line[safe_strlen (line)] = ':';
+ line[mutt_strlen (line)] = ':';
if (weed && option (OPTWEED) && mutt_matches_ignore (line, Ignore)
&& !mutt_matches_ignore (line, UnIgnore))
}
if (e->spam && e->spam->data)
- dprint (5, (debugfile, "p822: spam = %s\n", e->spam->data));
+ debug_print (5, ("spam = %s\n", e->spam->data));
}
}
/* check for missing or invalid date */
if (hdr->date_sent <= 0) {
- dprint (1,
- (debugfile,
- "read_rfc822_header(): no date found, using received time from msg separator\n"));
+ debug_print (1, ("no date found, using received time from msg separator\n"));
hdr->date_sent = hdr->received;
}
}