This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Undernet IRC Server Source Code.".

The branch, u2_10_12_branch has been updated
       via  aaa00fb6edcf84b99f8ed210408103630e1f4c39 (commit)
      from  1548621343dcb96279d7ef85f5fb9c96120015ce (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit aaa00fb6edcf84b99f8ed210408103630e1f4c39
Author: Michael Poole <[email protected]>
Date:   Wed Aug 16 20:42:54 2017 -0400

    match(): Only treat \ as an escape when it is before * or ?.

diff --git a/ircd/match.c b/ircd/match.c
index b585053..7081555 100644
--- a/ircd/match.c
+++ b/ircd/match.c
@@ -205,11 +205,9 @@ int match(const char *mask, const char *name)
       return 1;
     break;
   case '\\':
-    m++;
-    /* allow escaping to force capitalization */
-    if (*m++ != *n++)
-      goto backtrack;
-    break;
+    if ((m[1] == '*') || (m[1] == '?'))
+      m++;
+    goto normal_character;
   case '*': case '?':
     for (star_p = 0; ; m++) {
       if (*m == '*')
@@ -222,18 +220,12 @@ int match(const char *mask, const char *name)
     if (star_p) {
       if (!*m)
         return 0;
-      else if (*m == '\\') {
-        m_tmp = ++m;
-        if (!*m)
-          return 1;
-        for (n_tmp = n; *n && *n != *m; n++) ;
-      } else {
-        m_tmp = m;
-        for (n_tmp = n; *n && ToLower(*n) != ToLower(*m); n++) ;
-      }
+      m_tmp = m;
+      for (n_tmp = n; *n && ToLower(*n) != ToLower(*m); n++) ;
     }
     /* and fall through */
   default:
+  normal_character:
     if (!*n)
       return *m != '\0';
     if (ToLower(*m) != ToLower(*n))
diff --git a/ircd/test/ircd_match_t.c b/ircd/test/ircd_match_t.c
index b675cd6..8eb7cdf 100644
--- a/ircd/test/ircd_match_t.c
+++ b/ircd/test/ircd_match_t.c
@@ -53,7 +53,7 @@ const struct match_test match_tests[] = {
   { "\\?",
     "?\0",
     "a\0" },
-  { "*\\\\[*!~*",
+  { "*\\[*!~*",
     "har\\[dy!~boy\0",
     "dark\\s|de!pimp\0joe\\[mama\0" },
   { NULL, NULL, NULL }
-----------------------------------------------------------------------

Summary of changes:
 ircd/match.c             | 20 ++++++--------------
 ircd/test/ircd_match_t.c |  2 +-
 2 files changed, 7 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
Undernet IRC Server Source Code.
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to