use m_strdup and m_strlen that are inlined for efficiency
[apps/madmutt.git] / pattern.c
index 585e130..f4c0548 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -12,6 +12,7 @@
 #endif
 
 #include <lib-lib/mem.h>
+#include <lib-lib/str.h>
 #include <lib-lib/macros.h>
 
 #include "mutt.h"
@@ -25,7 +26,6 @@
 #include "copy.h"
 #include "mime.h"
 
-#include "lib/str.h"
 
 #ifdef USE_IMAP
 #include "mx.h"
@@ -225,7 +225,7 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno)
         match = 1;
         break;
       }
-      lng -= str_len (buf);
+      lng -= m_strlen(buf);
     }
 
     p_delete(&buf);
@@ -266,7 +266,7 @@ int eat_regexp (pattern_t * pat, BUFFER * s, BUFFER * err)
 #endif
 
   if (pat->stringmatch) {
-    pat->str = str_dup (buf.data);
+    pat->str = m_strdup(buf.data);
     p_delete(&buf.data);
   } else {
     pat->rx = p_new(regex_t, 1);
@@ -714,7 +714,7 @@ pattern_t *mutt_pattern_comp ( /* const */ char *s, int flags, BUFFER * err)
 
   memset (&ps, 0, sizeof (ps));
   ps.dptr = s;
-  ps.dsize = str_len (s);
+  ps.dsize = m_strlen(s);
 
   while (*ps.dptr) {
     SKIPWS (ps.dptr);
@@ -1209,7 +1209,7 @@ int mutt_pattern_func (int op, char *prompt)
 
   mutt_message _("Compiling search pattern...");
 
-  simple = str_dup (buf);
+  simple = m_strdup(buf);
   mutt_check_simple (buf, sizeof (buf), NONULL (SimpleSearch));
 
   err.data = error;