X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-mime%2Frfc1524.c;h=fc0206292976aa7d5a1e2bc6ce0a00212e9885d2;hp=576f2122fdc19f43e108b1c4923d8fd3bfc28c56;hb=75b25db9f40ea7bbd11e63652d5fae591b3f1206;hpb=c8b8b9539aaf11b48c4c1e5baba434db09722111 diff --git a/lib-mime/rfc1524.c b/lib-mime/rfc1524.c index 576f212..fc02062 100644 --- a/lib-mime/rfc1524.c +++ b/lib-mime/rfc1524.c @@ -169,7 +169,8 @@ static char *parse_field(char *p, char **field, char **value) *p++ = '\0'; case '\0': m_strrtrim(*field); - m_strrtrim(*value); + if (*value) + m_strrtrim(*value); return p; case '\\': @@ -301,7 +302,7 @@ rfc1524_mailcap_parse(BODY *a, const char *filename, const char *type, ssize_t len = m_strlen(value) + STRING; char *testcmd = p_new(char, len); - strcpy(testcmd, value); + m_strcpy(testcmd, len, value); rfc1524_expand_command(a, a->filename, type, testcmd, len); found = !mutt_system(testcmd); p_delete(&testcmd); @@ -338,7 +339,7 @@ rfc1524_mailcap_parse(BODY *a, const char *filename, const char *type, rfc1524_entry_init(entry); } } /* while (!found && (buf = mutt_read_line ())) */ - fclose (fp); + m_fclose(&fp); error: p_delete(&buf); @@ -374,7 +375,7 @@ int rfc1524_mailcap_lookup (BODY * a, char *type, rfc1524_entry * entry, return 0; } - mutt_check_lookup_list (a, type, SHORT_STRING); + mutt_check_lookup_list (a, type, STRING); while (!found && *curr) { x = 0; @@ -437,7 +438,7 @@ int rfc1524_expand_filename (char *nametemplate, m_strcpy(newfile, nflen, oldfile); } else if (!oldfile) { - m_snsubst(newfile, nflen, nametemplate, "mutt"); + m_file_fmt(newfile, nflen, nametemplate, "mutt"); } else { /* oldfile && nametemplate */