projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Nico Golde:
[apps/madmutt.git]
/
parse.c
diff --git
a/parse.c
b/parse.c
index
5abfb06
..
ee8d70f
100644
(file)
--- a/
parse.c
+++ b/
parse.c
@@
-12,7
+12,7
@@
#endif
#include "mutt.h"
#endif
#include "mutt.h"
-#include "m
ailbo
x.h"
+#include "mx.h"
#include "mime.h"
#include "rfc2047.h"
#include "rfc2231.h"
#include "mime.h"
#include "rfc2047.h"
#include "rfc2231.h"
@@
-23,6
+23,7
@@
#include "lib/intl.h"
#include "lib/str.h"
#include "lib/rx.h"
#include "lib/intl.h"
#include "lib/str.h"
#include "lib/rx.h"
+#include "lib/debug.h"
#include <string.h>
#include <ctype.h>
#include <string.h>
#include <ctype.h>
@@
-46,7
+47,7
@@
static char *read_rfc822_line (FILE * f, char *line, size_t * linelen)
return (line);
}
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))
if (*buf == '\n') {
/* we did get a full line. remove trailing space */
while (ISSPACE (*buf))
@@
-95,7
+96,7
@@
LIST *mutt_parse_references (char *s, int in_reply_to)
new = NULL;
if (*s == '<') {
new = NULL;
if (*s == '<') {
- n =
safe
_strlen (s);
+ n =
mutt
_strlen (s);
if (s[n - 1] != '>') {
o = s;
s = NULL;
if (s[n - 1] != '>') {
o = s;
s = NULL;
@@
-105,7
+106,7
@@
LIST *mutt_parse_references (char *s, int in_reply_to)
new = safe_strdup (s);
}
else if (o) {
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__ */
if (s[m - 1] == '>') {
new = safe_malloc (sizeof (char) * (n + m + 1));
strcpy (new, o); /* __STRCPY_CHECKED__ */
@@
-168,12
+169,11
@@
static PARAMETER *parse_parameters (const char *s)
const char *p;
size_t i;
const char *p;
size_t i;
- d
print (2, (debugfile, "parse_parameters:
`%s'\n", s));
+ d
ebug_print (2, ("
`%s'\n", s));
while (*s) {
if ((p = strpbrk (s, "=;")) == NULL) {
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;
}
goto bail;
}
@@
-233,8
+233,7
@@
static PARAMETER *parse_parameters (const char *s)
new->value = safe_strdup (buffer);
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 */
new->value ? new->value : ""));
/* Add this parameter to the list */
@@
-246,9
+245,7
@@
static PARAMETER *parse_parameters (const char *s)
head = cur = new;
}
else {
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;
}
s = p;
}
@@
-431,16
+428,12
@@
BODY *mutt_read_mime_header (FILE * fp, int digest)
c++;
SKIPWS (c);
if (!*c) {
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 {
continue;
}
}
else {
- dprint (1,
- (debugfile, "read_mime_header: bogus MIME header: %s\n", line));
+ debug_print (1, ("bogus MIME header: %s\n", line));
break;
}
break;
}
@@
-589,9
+582,9
@@
BODY *mutt_parse_multipart (FILE * fp, const char *boundary, long end_off,
return (NULL);
}
return (NULL);
}
- blen =
safe
_strlen (boundary);
+ blen =
mutt
_strlen (boundary);
while (ftell (fp) < end_off && fgets (buffer, LONG_STRING, fp) != NULL) {
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;
crlf = (len > 1 && buffer[len - 2] == '\r') ? 1 : 0;
@@
-612,7
+605,7
@@
BODY *mutt_parse_multipart (FILE * fp, const char *boundary, long end_off,
buffer[i] = 0;
/* Check for the end boundary */
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 */
}
final = 1;
break; /* done parsing */
}
@@
-836,9
+829,7
@@
time_t mutt_parse_date (const char *s, HEADER * h)
else if (sscanf (t, "%d:%d", &hour, &min) == 2)
sec = 0;
else {
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;
return (-1);
}
tm.tm_hour = hour;
@@
-898,9
+889,7
@@
time_t mutt_parse_date (const char *s, HEADER * h)
}
if (count < 4) { /* don't check for missing timezone */
}
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);
}
return (-1);
}
@@
-1048,8
+1037,8
@@
int mutt_parse_rfc822_line (ENVELOPE * e, HEADER * hdr, char *line, char *p,
#ifdef USE_NNTP
else if (!safe_strcasecmp (line + 1, "ollowup-to")) {
if (!e->followup_to) {
#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_trail
ws (p);
+ e->followup_to = safe_strdup (
str_skip_initws
(p));
}
matched = 1;
}
}
matched = 1;
}
@@
-1131,8
+1120,8
@@
int mutt_parse_rfc822_line (ENVELOPE * e, HEADER * hdr, char *line, char *p,
case 'n':
if (!safe_strcasecmp (line + 1, "ewsgroups")) {
FREE (&e->newsgroups);
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_trail
ws (p);
+ e->newsgroups = safe_strdup (
str_skip_initws
(p));
matched = 1;
}
break;
matched = 1;
}
break;
@@
-1257,7
+1246,7
@@
int mutt_parse_rfc822_line (ENVELOPE * e, HEADER * hdr, char *line, char *p,
/* Keep track of the user-defined headers */
if (!matched && user_hdrs) {
/* restore the original line */
/* 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 (weed && option (OPTWEED) && mutt_matches_ignore (line, Ignore)
&& !mutt_matches_ignore (line, UnIgnore))
@@
-1380,7
+1369,7
@@
ENVELOPE *mutt_read_rfc822_header (FILE * f, HEADER * hdr, short user_hdrs,
}
if (e->spam && e->spam->data)
}
if (e->spam && e->spam->data)
- d
print (5, (debugfile, "p822:
spam = %s\n", e->spam->data));
+ d
ebug_print (5, ("
spam = %s\n", e->spam->data));
}
}
}
}
@@
-1424,9
+1413,7
@@
ENVELOPE *mutt_read_rfc822_header (FILE * f, HEADER * hdr, short user_hdrs,
/* check for missing or invalid date */
if (hdr->date_sent <= 0) {
/* 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;
}
}
hdr->date_sent = hdr->received;
}
}