Simplify charset.cpkg a bit
[apps/madmutt.git] / pattern.c
index ea72544..eb58688 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -141,7 +141,7 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno)
       p_clear(&s, 1);
       s.fpin = msg->fp;
       s.flags = M_CHARCONV;
-      s.fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+      s.fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
       if (!s.fpout) {
         mutt_error(_("Could not create temporary file"));
         return (0);
@@ -631,20 +631,16 @@ static const struct pattern_flags *lookup_tag (char tag)
   return NULL;
 }
 
-static /* const */ char *find_matching_paren ( /* const */ char *s)
+static const char *find_matching_paren (const char *s)
 {
-  int level = 1;
-
-  for (; *s; s++) {
-    if (*s == '(')
-      level++;
-    else if (*s == ')') {
-      level--;
-      if (!level)
-        break;
+    int level = 1;
+
+    for (; *s; s++) {
+        level += (*s == '(') - (*s == ')');
+        if (!level)
+            break;
     }
-  }
-  return s;
+    return s;
 }
 
 pattern_t *mutt_pattern_comp(const char *s, int flags, BUFFER *err)