diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1998-11-10 22:14:00 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1998-11-10 22:14:00 +0000 |
commit | a3f726e35f1e7d918061074a85ebe7a2c7c300a5 (patch) | |
tree | d9ab2a281be2a13fbb1ec8682d4e5c7ff0502cde /handler.c | |
parent | 912c6b0df82fe3a2745d68131db9300222226a73 (diff) |
Introduce or rewrite mutt_{str*cmp,strlen} and use them all over the
place. If there are still segmentation faults due to missing
NONULLs over, they are gone now.
Diffstat (limited to 'handler.c')
-rw-r--r-- | handler.c | 76 |
1 files changed, 38 insertions, 38 deletions
@@ -319,16 +319,16 @@ void mutt_decode_uuencoded (STATE *s, BODY *b, int istext) { if ((fgets(tmps, sizeof(tmps), s->fpin)) == NULL) return; - len -= strlen(tmps); - if ((!strncmp (tmps, "begin", 5)) && ISSPACE (tmps[5])) + len -= mutt_strlen(tmps); + if ((!mutt_strncmp (tmps, "begin", 5)) && ISSPACE (tmps[5])) break; } while(len > 0) { if ((fgets(tmps, sizeof(tmps), s->fpin)) == NULL) return; - len -= strlen(tmps); - if (!strncmp (tmps, "end", 3)) + len -= mutt_strlen(tmps); + if (!mutt_strncmp (tmps, "end", 3)) break; pt = tmps; linelen = decode_byte (*pt); @@ -479,7 +479,7 @@ static void enriched_wrap (struct enriched_state *stte) if (stte->s->prefix) { state_puts (stte->s->prefix, stte->s); - stte->indent_len += strlen (stte->s->prefix); + stte->indent_len += mutt_strlen (stte->s->prefix); } if (stte->tag_level[RICH_EXCERPT]) @@ -490,12 +490,12 @@ static void enriched_wrap (struct enriched_state *stte) if (stte->s->prefix) { state_puts (stte->s->prefix, stte->s); - stte->indent_len += strlen (stte->s->prefix); + stte->indent_len += mutt_strlen (stte->s->prefix); } else { state_puts ("> ", stte->s); - stte->indent_len += strlen ("> "); + stte->indent_len += mutt_strlen ("> "); } x--; } @@ -608,7 +608,7 @@ static void enriched_puts (char *s, struct enriched_state *stte) { char *c; - if (stte->buff_len < stte->buff_used + strlen(s)) + if (stte->buff_len < stte->buff_used + mutt_strlen(s)) { stte->buff_len += LONG_STRING; safe_realloc ((void **) &stte->buffer, stte->buff_len + 1); @@ -630,7 +630,7 @@ static void enriched_set_flags (const char *tag, struct enriched_state *stte) tagptr++; for (i = 0, j = -1; EnrichedTags[i].tag_name; i++) - if (strcasecmp (EnrichedTags[i].tag_name,tagptr) == 0) + if (mutt_strcasecmp (EnrichedTags[i].tag_name,tagptr) == 0) { j = EnrichedTags[i].index; break; @@ -648,35 +648,35 @@ static void enriched_set_flags (const char *tag, struct enriched_state *stte) if ((stte->s->flags & M_DISPLAY) && j == RICH_PARAM && stte->tag_level[RICH_COLOR]) { stte->param[stte->param_len] = '\0'; - if (!strcasecmp(stte->param, "black")) + if (!mutt_strcasecmp(stte->param, "black")) { enriched_puts("\033[30m", stte); } - else if (!strcasecmp(stte->param, "red")) + else if (!mutt_strcasecmp(stte->param, "red")) { enriched_puts("\033[31m", stte); } - else if (!strcasecmp(stte->param, "green")) + else if (!mutt_strcasecmp(stte->param, "green")) { enriched_puts("\033[32m", stte); } - else if (!strcasecmp(stte->param, "yellow")) + else if (!mutt_strcasecmp(stte->param, "yellow")) { enriched_puts("\033[33m", stte); } - else if (!strcasecmp(stte->param, "blue")) + else if (!mutt_strcasecmp(stte->param, "blue")) { enriched_puts("\033[34m", stte); } - else if (!strcasecmp(stte->param, "magenta")) + else if (!mutt_strcasecmp(stte->param, "magenta")) { enriched_puts("\033[35m", stte); } - else if (!strcasecmp(stte->param, "cyan")) + else if (!mutt_strcasecmp(stte->param, "cyan")) { enriched_puts("\033[36m", stte); } - else if (!strcasecmp(stte->param, "white")) + else if (!mutt_strcasecmp(stte->param, "white")) { enriched_puts("\033[37m", stte); } @@ -718,7 +718,7 @@ void text_enriched_handler (BODY *a, STATE *s) if (s->prefix) { state_puts (s->prefix, s); - stte.indent_len += strlen (s->prefix); + stte.indent_len += mutt_strlen (s->prefix); } while (state != DONE) @@ -846,7 +846,7 @@ static void alternative_handler (BODY *a, STATE *s) else { wild = 1; - btlen = strlen (t->data); + btlen = mutt_strlen (t->data); } if (a && a->parts) @@ -856,10 +856,10 @@ static void alternative_handler (BODY *a, STATE *s) while (b) { const char *bt = TYPE(b); - if (!strncasecmp (bt, t->data, btlen) && bt[btlen] == 0) + if (!mutt_strncasecmp (bt, t->data, btlen) && bt[btlen] == 0) { /* the basetype matches */ - if (wild || !strcasecmp (t->data + btlen + 1, b->subtype)) + if (wild || !mutt_strcasecmp (t->data + btlen + 1, b->subtype)) { choice = b; } @@ -904,17 +904,17 @@ static void alternative_handler (BODY *a, STATE *s) { if (b->type == TYPETEXT) { - if (! strcasecmp ("plain", b->subtype) && type <= TXTPLAIN) + if (! mutt_strcasecmp ("plain", b->subtype) && type <= TXTPLAIN) { choice = b; type = TXTPLAIN; } - else if (! strcasecmp ("enriched", b->subtype) && type <= TXTENRICHED) + else if (! mutt_strcasecmp ("enriched", b->subtype) && type <= TXTENRICHED) { choice = b; type = TXTENRICHED; } - else if (! strcasecmp ("html", b->subtype) && type <= TXTHTML) + else if (! mutt_strcasecmp ("html", b->subtype) && type <= TXTHTML) { choice = b; type = TXTHTML; @@ -1010,8 +1010,8 @@ int mutt_can_decode (BODY *a) #ifdef _PGPPATH - if (strcasecmp (a->subtype, "signed") == 0 || - strcasecmp (a->subtype, "encrypted") == 0) + if (mutt_strcasecmp (a->subtype, "signed") == 0 || + mutt_strcasecmp (a->subtype, "encrypted") == 0) return (1); else #endif @@ -1060,7 +1060,7 @@ void multipart_handler (BODY *a, STATE *s) b->length = (long) st.st_size; b->parts = mutt_parse_multipart (s->fpin, mutt_get_parameter ("boundary", a->parameter), - (long) st.st_size, strcasecmp ("digest", a->subtype) == 0); + (long) st.st_size, mutt_strcasecmp ("digest", a->subtype) == 0); } else b = a; @@ -1263,7 +1263,7 @@ static void external_body_handler (BODY *b, STATE *s) else expire = -1; - if (!strcasecmp (access_type, "x-mutt-deleted")) + if (!mutt_strcasecmp (access_type, "x-mutt-deleted")) { if (s->flags & M_DISPLAY) { @@ -1335,25 +1335,25 @@ void mutt_body_handler (BODY *b, STATE *s) } else if (b->type == TYPETEXT) { - if (strcasecmp ("plain", b->subtype) == 0) + if (mutt_strcasecmp ("plain", b->subtype) == 0) { /* avoid copying this part twice since removing the transfer-encoding is * the only operation needed. */ plaintext = 1; } - else if (strcasecmp ("enriched", b->subtype) == 0) + else if (mutt_strcasecmp ("enriched", b->subtype) == 0) handler = text_enriched_handler; - else if (strcasecmp ("rfc822-headers", b->subtype) == 0) + else if (mutt_strcasecmp ("rfc822-headers", b->subtype) == 0) plaintext = 1; } else if (b->type == TYPEMESSAGE) { if(mutt_is_message_type(b->type, b->subtype)) handler = message_handler; - else if (!strcasecmp ("delivery-status", b->subtype)) + else if (!mutt_strcasecmp ("delivery-status", b->subtype)) plaintext = 1; - else if (!strcasecmp ("external-body", b->subtype)) + else if (!mutt_strcasecmp ("external-body", b->subtype)) handler = external_body_handler; } else if (b->type == TYPEMULTIPART) @@ -1367,31 +1367,31 @@ void mutt_body_handler (BODY *b, STATE *s) - if (strcasecmp ("alternative", b->subtype) == 0) + if (mutt_strcasecmp ("alternative", b->subtype) == 0) handler = alternative_handler; #ifdef _PGPPATH - else if (strcasecmp ("signed", b->subtype) == 0) + else if (mutt_strcasecmp ("signed", b->subtype) == 0) { p = mutt_get_parameter ("protocol", b->parameter); if (!p) mutt_error _("Error: multipart/signed has no protocol."); - else if (strcasecmp ("application/pgp-signature", p) == 0) + else if (mutt_strcasecmp ("application/pgp-signature", p) == 0) { if (s->flags & M_VERIFY) handler = pgp_signed_handler; } } - else if (strcasecmp ("encrypted", b->subtype) == 0) + else if (mutt_strcasecmp ("encrypted", b->subtype) == 0) { p = mutt_get_parameter ("protocol", b->parameter); if (!p) mutt_error _("Error: multipart/encrypted has no protocol parameter!"); - else if (strcasecmp ("application/pgp-encrypted", p) == 0) + else if (mutt_strcasecmp ("application/pgp-encrypted", p) == 0) handler = pgp_encrypted_handler; } #endif /* _PGPPATH */ |