make m_dupstr return NULL if the string was empty.
[apps/madmutt.git] / pattern.c
index 46efa88..03b3940 100644 (file)
--- a/pattern.c
+++ b/pattern.c
 #include <lib-lib/ascii.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
+#include <lib-lib/file.h>
+#include <lib-lib/buffer.h>
 
 #include "mutt.h"
-#include "buffer.h"
 #include "handler.h"
 #include "enter.h"
 #include "mx.h"
@@ -1170,7 +1171,7 @@ void mutt_check_simple (char *s, size_t len, const char *simple)
 
   if (!strchr (s, '~') && !strchr (s, '=')) {       /* yup, so spoof a real request */
     /* convert old tokens into the new format */
-    if (ascii_strcasecmp ("all", s) == 0 || !str_cmp ("^", s) || !str_cmp (".", s))     /* ~A is more efficient */
+    if (ascii_strcasecmp ("all", s) == 0 || !m_strcmp("^", s) || !m_strcmp(".", s))     /* ~A is more efficient */
       strfcpy (s, "~A", len);
     else if (ascii_strcasecmp ("del", s) == 0)
       strfcpy (s, "~D", len);
@@ -1326,7 +1327,7 @@ int mutt_search_command (int cur, int op)
     strfcpy (temp, buf, sizeof (temp));
     mutt_check_simple (temp, sizeof (temp), NONULL (SimpleSearch));
 
-    if (!SearchPattern || str_cmp (temp, LastSearchExpn)) {
+    if (!SearchPattern || m_strcmp(temp, LastSearchExpn)) {
       set_option (OPTSEARCHINVALID);
       strfcpy (LastSearch, buf, sizeof (LastSearch));
       mutt_message _("Compiling search pattern...");