projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rocco Rutte:
[apps/madmutt.git]
/
handler.c
diff --git
a/handler.c
b/handler.c
index
505fb38
..
8373635
100644
(file)
--- a/
handler.c
+++ b/
handler.c
@@
-242,7
+242,7
@@
void mutt_decode_quoted (STATE * s, long len, int istext, iconv_t cd)
if (fgets (line, MIN ((ssize_t) sizeof (line), len + 1), s->fpin) == NULL)
break;
if (fgets (line, MIN ((ssize_t) sizeof (line), len + 1), s->fpin) == NULL)
break;
- linelen =
mutt_str
len (line);
+ linelen =
str_
len (line);
len -= linelen;
/*
len -= linelen;
/*
@@
-369,15
+369,15
@@
void mutt_decode_uuencoded (STATE * s, long len, int istext, iconv_t cd)
while (len > 0) {
if ((fgets (tmps, sizeof (tmps), s->fpin)) == NULL)
return;
while (len > 0) {
if ((fgets (tmps, sizeof (tmps), s->fpin)) == NULL)
return;
- len -=
mutt_str
len (tmps);
- if ((!s
afe_str
ncmp (tmps, "begin", 5)) && ISSPACE (tmps[5]))
+ len -=
str_
len (tmps);
+ if ((!s
tr_
ncmp (tmps, "begin", 5)) && ISSPACE (tmps[5]))
break;
}
while (len > 0) {
if ((fgets (tmps, sizeof (tmps), s->fpin)) == NULL)
return;
break;
}
while (len > 0) {
if ((fgets (tmps, sizeof (tmps), s->fpin)) == NULL)
return;
- len -=
mutt_str
len (tmps);
- if (!s
afe_str
ncmp (tmps, "end", 3))
+ len -=
str_
len (tmps);
+ if (!s
tr_
ncmp (tmps, "end", 3))
break;
pt = tmps;
linelen = decode_byte (*pt);
break;
pt = tmps;
linelen = decode_byte (*pt);
@@
-517,7
+517,7
@@
static void enriched_wrap (struct enriched_state *stte)
stte->indent_len = 0;
if (stte->s->prefix) {
state_puts (stte->s->prefix, stte->s);
stte->indent_len = 0;
if (stte->s->prefix) {
state_puts (stte->s->prefix, stte->s);
- stte->indent_len +=
mutt_str
len (stte->s->prefix);
+ stte->indent_len +=
str_
len (stte->s->prefix);
}
if (stte->tag_level[RICH_EXCERPT]) {
}
if (stte->tag_level[RICH_EXCERPT]) {
@@
-525,11
+525,11
@@
static void enriched_wrap (struct enriched_state *stte)
while (x) {
if (stte->s->prefix) {
state_puts (stte->s->prefix, stte->s);
while (x) {
if (stte->s->prefix) {
state_puts (stte->s->prefix, stte->s);
- stte->indent_len +=
mutt_str
len (stte->s->prefix);
+ stte->indent_len +=
str_
len (stte->s->prefix);
}
else {
state_puts ("> ", stte->s);
}
else {
state_puts ("> ", stte->s);
- stte->indent_len +=
mutt_str
len ("> ");
+ stte->indent_len +=
str_
len ("> ");
}
x--;
}
}
x--;
}
@@
-559,7
+559,7
@@
static void enriched_flush (struct enriched_state *stte, int wrap)
stte->line_used += stte->buff_used;
if (stte->line_used > stte->line_max) {
stte->line_max = stte->line_used;
stte->line_used += stte->buff_used;
if (stte->line_used > stte->line_max) {
stte->line_max = stte->line_used;
-
safe
_realloc (&stte->line, stte->line_max + 1);
+
mem
_realloc (&stte->line, stte->line_max + 1);
}
strcat (stte->line, stte->buffer); /* __STRCAT_CHECKED__ */
stte->line_len += stte->word_len;
}
strcat (stte->line, stte->buffer); /* __STRCAT_CHECKED__ */
stte->line_len += stte->word_len;
@@
-576,7
+576,7
@@
static void enriched_putc (int c, struct enriched_state *stte)
if (stte->tag_level[RICH_PARAM]) {
if (stte->tag_level[RICH_COLOR]) {
if (stte->param_used + 1 >= stte->param_len)
if (stte->tag_level[RICH_PARAM]) {
if (stte->tag_level[RICH_COLOR]) {
if (stte->param_used + 1 >= stte->param_len)
-
safe
_realloc (&stte->param, (stte->param_len += STRING));
+
mem
_realloc (&stte->param, (stte->param_len += STRING));
stte->param[stte->param_used++] = c;
}
stte->param[stte->param_used++] = c;
}
@@
-586,7
+586,7
@@
static void enriched_putc (int c, struct enriched_state *stte)
/* see if more space is needed (plus extra for possible rich characters) */
if (stte->buff_len < stte->buff_used + 3) {
stte->buff_len += LONG_STRING;
/* see if more space is needed (plus extra for possible rich characters) */
if (stte->buff_len < stte->buff_used + 3) {
stte->buff_len += LONG_STRING;
-
safe
_realloc (&stte->buffer, stte->buff_len + 1);
+
mem
_realloc (&stte->buffer, stte->buff_len + 1);
}
if ((!stte->tag_level[RICH_NOFILL] && ISSPACE (c)) || c == '\0') {
}
if ((!stte->tag_level[RICH_NOFILL] && ISSPACE (c)) || c == '\0') {
@@
-631,9
+631,9
@@
static void enriched_puts (char *s, struct enriched_state *stte)
{
char *c;
{
char *c;
- if (stte->buff_len < stte->buff_used +
mutt_str
len (s)) {
+ if (stte->buff_len < stte->buff_used +
str_
len (s)) {
stte->buff_len += LONG_STRING;
stte->buff_len += LONG_STRING;
-
safe
_realloc (&stte->buffer, stte->buff_len + 1);
+
mem
_realloc (&stte->buffer, stte->buff_len + 1);
}
c = s;
while (*c) {
}
c = s;
while (*c) {
@@
-727,15
+727,15
@@
void text_enriched_handler (BODY * a, STATE * s)
((s->flags & M_DISPLAY) ? (COLS - 4) : ((COLS - 4) <
72) ? (COLS - 4) : 72);
stte.line_max = stte.WrapMargin * 4;
((s->flags & M_DISPLAY) ? (COLS - 4) : ((COLS - 4) <
72) ? (COLS - 4) : 72);
stte.line_max = stte.WrapMargin * 4;
- stte.line = (char *)
safe
_calloc (1, stte.line_max + 1);
- stte.param = (char *)
safe
_calloc (1, STRING);
+ stte.line = (char *)
mem
_calloc (1, stte.line_max + 1);
+ stte.param = (char *)
mem
_calloc (1, STRING);
stte.param_len = STRING;
stte.param_used = 0;
if (s->prefix) {
state_puts (s->prefix, s);
stte.param_len = STRING;
stte.param_used = 0;
if (s->prefix) {
state_puts (s->prefix, s);
- stte.indent_len +=
mutt_str
len (s->prefix);
+ stte.indent_len +=
str_
len (s->prefix);
}
while (state != DONE) {
}
while (state != DONE) {
@@
-819,9
+819,9
@@
void text_enriched_handler (BODY * a, STATE * s)
state_putc ('\n', s); /* add a final newline */
state_putc ('\n', s); /* add a final newline */
-
FREE
(&(stte.buffer));
-
FREE
(&(stte.line));
-
FREE
(&(stte.param));
+
mem_free
(&(stte.buffer));
+
mem_free
(&(stte.line));
+
mem_free
(&(stte.param));
}
/*
}
/*
@@
-845,7
+845,7
@@
static void print_flowed_line (char *line, STATE * s, int ql)
{
int width;
char *pos, *oldpos;
{
int width;
char *pos, *oldpos;
- int len =
mutt_str
len (line);
+ int len =
str_
len (line);
int i;
if (MaxLineLength > 0) {
int i;
if (MaxLineLength > 0) {
@@
-869,7
+869,7
@@
static void print_flowed_line (char *line, STATE * s, int ql)
/* fprintf(stderr,"print_flowed_line will print `%s' with ql = %d\n",line,ql); */
/* fprintf(stderr,"print_flowed_line will print `%s' with ql = %d\n",line,ql); */
- if (
mutt_str
len (line) == 0) {
+ if (
str_
len (line) == 0) {
if (option (OPTQUOTEEMPTY)) {
if (s->prefix)
state_puts(s->prefix,s);
if (option (OPTQUOTEEMPTY)) {
if (s->prefix)
state_puts(s->prefix,s);
@@
-950,24
+950,24
@@
static void text_plain_flowed_handler (BODY * a, STATE * s)
while (bytes > 0 && fgets (buf, sizeof (buf), s->fpin)) {
while (bytes > 0 && fgets (buf, sizeof (buf), s->fpin)) {
- bytes -=
mutt_str
len (buf);
+ bytes -=
str_
len (buf);
newql = get_quote_level (buf);
if ((t = strrchr (buf, '\n')) || (t = strrchr (buf, '\r'))) {
*t = '\0';
newql = get_quote_level (buf);
if ((t = strrchr (buf, '\n')) || (t = strrchr (buf, '\r'))) {
*t = '\0';
- if (
mutt_strlen (curline) > 0 && curline[mutt_str
len (curline) - 1] == ' '
+ if (
str_len (curline) > 0 && curline[str_
len (curline) - 1] == ' '
&& newql == quotelevel
&& strcmp (curline + quotelevel, "-- ") != 0) {
if (buf[newql] == ' ')
&& newql == quotelevel
&& strcmp (curline + quotelevel, "-- ") != 0) {
if (buf[newql] == ' ')
- curline[
mutt_str
len (curline) - 1] = '\0';
+ curline[
str_
len (curline) - 1] = '\0';
- curline = realloc (curline, curline_len +
mutt_str
len (buf));
+ curline = realloc (curline, curline_len +
str_
len (buf));
if (curline_len == 1)
*curline = '\0';
if (curline_len == 1)
*curline = '\0';
- curline_len +=
mutt_str
len (buf);
- s
afe_str
ncat (curline, curline_len, buf + newql,
-
mutt_str
len (buf + newql));
+ curline_len +=
str_
len (buf);
+ s
tr_
ncat (curline, curline_len, buf + newql,
+
str_
len (buf + newql));
}
else {
if (first_line) {
}
else {
if (first_line) {
@@
-976,13
+976,13
@@
static void text_plain_flowed_handler (BODY * a, STATE * s)
else {
print_flowed_line (curline, s, quotelevel);
}
else {
print_flowed_line (curline, s, quotelevel);
}
-
FREE
(&curline);
+
mem_free
(&curline);
curline_len = 1;
curline_len = 1;
- curline = realloc (curline, curline_len +
mutt_str
len (buf));
+ curline = realloc (curline, curline_len +
str_
len (buf));
if (curline_len == 1)
*curline = '\0';
if (curline_len == 1)
*curline = '\0';
- curline_len +=
mutt_str
len (buf);
- s
afe_strncat (curline, curline_len, buf, mutt_str
len (buf));
+ curline_len +=
str_
len (buf);
+ s
tr_ncat (curline, curline_len, buf, str_
len (buf));
quotelevel = newql;
}
}
quotelevel = newql;
}
}
@@
-990,19
+990,19
@@
static void text_plain_flowed_handler (BODY * a, STATE * s)
/* in case there's no line end it's likely the last line
* so append to current (if any) */
if (buf[newql] == ' ')
/* in case there's no line end it's likely the last line
* so append to current (if any) */
if (buf[newql] == ' ')
- curline[
mutt_str
len (curline) - 1] = '\0';
- curline = realloc (curline, curline_len +
mutt_str
len (buf));
+ curline[
str_
len (curline) - 1] = '\0';
+ curline = realloc (curline, curline_len +
str_
len (buf));
if (curline_len == 1)
*curline = '\0';
if (curline_len == 1)
*curline = '\0';
- curline_len +=
mutt_str
len (buf);
- s
afe_str
ncat (curline, curline_len, buf + newql,
-
mutt_str
len (buf + newql));
+ curline_len +=
str_
len (buf);
+ s
tr_
ncat (curline, curline_len, buf + newql,
+
str_
len (buf + newql));
break;
}
}
if (curline) {
print_flowed_line (curline, s, quotelevel);
break;
}
}
if (curline) {
print_flowed_line (curline, s, quotelevel);
-
FREE
(&curline);
+
mem_free
(&curline);
}
}
}
}
@@
-1053,7
+1053,7
@@
static void alternative_handler (BODY * a, STATE * s)
}
else {
wild = 1;
}
else {
wild = 1;
- btlen =
mutt_str
len (t->data);
+ btlen =
str_
len (t->data);
}
if (a && a->parts)
}
if (a && a->parts)
@@
-1310,11
+1310,11
@@
void autoview_handler (BODY * a, STATE * s)
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
rfc1524_mailcap_lookup (a, type, entry, M_AUTOVIEW);
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
rfc1524_mailcap_lookup (a, type, entry, M_AUTOVIEW);
- fname = s
afe_str
dup (a->filename);
+ fname = s
tr_
dup (a->filename);
mutt_sanitize_filename (fname, 1);
rfc1524_expand_filename (entry->nametemplate, fname, tempfile,
sizeof (tempfile));
mutt_sanitize_filename (fname, 1);
rfc1524_expand_filename (entry->nametemplate, fname, tempfile,
sizeof (tempfile));
-
FREE
(&fname);
+
mem_free
(&fname);
if (entry->command) {
strfcpy (command, entry->command, sizeof (command));
if (entry->command) {
strfcpy (command, entry->command, sizeof (command));
@@
-1602,7
+1602,7
@@
void mutt_body_handler (BODY * b, STATE * s)
handler = mutt_signed_handler;
}
else if ((WithCrypto & APPLICATION_PGP)
handler = mutt_signed_handler;
}
else if ((WithCrypto & APPLICATION_PGP)
- && s
afe_str
casecmp ("encrypted", b->subtype) == 0) {
+ && s
tr_
casecmp ("encrypted", b->subtype) == 0) {
p = mutt_get_parameter ("protocol", b->parameter);
if (!p)
p = mutt_get_parameter ("protocol", b->parameter);
if (!p)