X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=muttlib.c;h=4b1352645b105138eb9bf845bd89f1424fce6d22;hp=81a0788ad6c25645754361f02c1be79aaef4c408;hb=09a7c8b5bbcc1630207e799d07e4ac438c9c3f1c;hpb=c8b8b9539aaf11b48c4c1e5baba434db09722111 diff --git a/muttlib.c b/muttlib.c index 81a0788..4b13526 100644 --- a/muttlib.c +++ b/muttlib.c @@ -250,13 +250,12 @@ void mutt_pretty_mailbox (char *s) } } -void mutt_expand_file_fmt(char *dest, ssize_t destlen, - const char *fmt, const char *src) +void +mutt_expand_file_fmt(char *dst, ssize_t n, const char *fmt, const char *src) { char tmp[LONG_STRING]; - mutt_quote_filename(tmp, sizeof(tmp), src); - m_snsubst(dest, destlen, fmt, tmp); + m_snsubst(dst, n, fmt, tmp); } /* return 0 on success, -1 on abort, 1 on error */ @@ -293,9 +292,8 @@ int mutt_check_overwrite (const char *attname, const char *path, } } else - if ((rc = - mutt_yesorno (_("File is a directory, save under it?"), - M_YES)) != M_YES) + if ((rc = mutt_yesorno(_("File is a directory, save under it?"), + M_YES)) != M_YES) return (rc == M_NO) ? 1 : -1; if (!attname || !attname[0]) { @@ -559,16 +557,6 @@ void mutt_FormatString (char *dest, /* output buffer */ } } *wptr = 0; - -#if 0 - if (flags & M_FORMAT_MAKEPRINT) { - /* Make sure that the string is printable by changing all non-printable - chars to dots, or spaces for non-printable whitespace */ - for (cp = dest; *cp; cp++) - if (!isprint(*cp) && !((flags & M_FORMAT_TREE) && (*cp <= M_TREE_MAX))) - *cp = isspace ((unsigned char) *cp) ? ' ' : '.'; - } -#endif } /* returns 0 if OK to proceed, -1 to abort, 1 to retry */ @@ -612,8 +600,7 @@ int mutt_save_confirm (const char *s, struct stat *st) mutt_error (_("%s is not a mailbox!"), s); return 1; } - } - else { + } else { if (magic != M_IMAP) { st->st_mtime = 0; @@ -627,8 +614,7 @@ int mutt_save_confirm (const char *s, struct stat *st) else if (rc == -1) ret = -1; } - } - else { + } else { mutt_perror (s); return 1; } @@ -681,22 +667,7 @@ const char *mutt_make_version (int full) return vstring; } -void mutt_free_spam_list (SPAM_LIST ** list) -{ - SPAM_LIST *p; - - if (!list) - return; - while (*list) { - p = *list; - *list = (*list)->next; - rx_delete(&p->rx); - p_delete(&p->template); - p_delete(&p); - } -} - -int mutt_match_spam_list (const char *s, SPAM_LIST * l, char *text, int x) +int mutt_match_spam_list (const char *s, rx_t * l, char *text, int x) { static regmatch_t *pmatch = NULL; static int nmatch = 0; @@ -716,8 +687,7 @@ int mutt_match_spam_list (const char *s, SPAM_LIST * l, char *text, int x) } /* Does this pattern match? */ - if (regexec(l->rx->rx, s, l->nmatch, (regmatch_t *)pmatch, (int) 0) == 0) - { + if (regexec(l->rx, s, l->nmatch, (regmatch_t *)pmatch, (int) 0) == 0) { /* Copy template into text, with substitutions. */ for (p = l->template; *p;) { if (*p == '%') {