X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pattern.c;h=4db49bf5f5e76ed3d8e1a1b33853e01c687ee11b;hp=40600b6ae8724f7b641550cddaf1d5dbb190ad0f;hb=3de2c85955793f4d6898884915121959ca465d0f;hpb=c8b8b9539aaf11b48c4c1e5baba434db09722111 diff --git a/pattern.c b/pattern.c index 40600b6..4db49bf 100644 --- a/pattern.c +++ b/pattern.c @@ -133,9 +133,9 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno) p_clear(&s, 1); s.fpin = msg->fp; s.flags = M_CHARCONV; - mutt_mktemp (tempfile); - if ((s.fpout = safe_fopen (tempfile, "w+")) == NULL) { - mutt_perror (tempfile); + s.fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL); + if (!s.fpout) { + mutt_error(_("Could not create temporary file")); return (0); } @@ -149,7 +149,7 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno) { mx_close_message (&msg); if (fp) { - fclose (fp); + m_fclose(&fp); unlink (tempfile); } return (0); @@ -200,7 +200,7 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno) mx_close_message (&msg); if (option (OPTTHOROUGHSRC)) { - fclose (fp); + m_fclose(&fp); unlink (tempfile); } } @@ -226,12 +226,6 @@ int eat_regexp (pattern_t * pat, BUFFER * s, BUFFER * err) return (-1); } -#if 0 - /* If there are no RE metacharacters, use simple search anyway */ - if (!pat->stringmatch && !strpbrk (buf.data, "|[{.*+?^$")) - pat->stringmatch = 1; -#endif - if (pat->stringmatch) { pat->str = m_strdup(buf.data); p_delete(&buf.data); @@ -1141,7 +1135,7 @@ void mutt_check_simple (char *s, ssize_t len, const char *simple) m_strcpy(s, len, "~U"); else { quote_simple (tmp, sizeof (tmp), s); - m_snsubst(s, len, simple, tmp); + m_file_fmt(s, len, simple, tmp); } } }