Merge "res_ael: Fix pattern matching against literal '+'"
authorJoshua Colp <jcolp@digium.com>
Tue, 16 Apr 2019 12:25:40 +0000 (07:25 -0500)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Tue, 16 Apr 2019 12:25:40 +0000 (07:25 -0500)
res/ael/pval.c

index 095cb88..c6623a4 100644 (file)
@@ -759,10 +759,10 @@ static int extension_matches(pval *here, const char *exten, const char *pattern)
                                *r++ = '.';
                                *r++ = '*';
                                break;
-                       case '*':
+                       case '*': /* regex metacharacter */
+                       case '+': /* regex metacharacter */
                                *r++ = '\\';
-                               *r++ = '*';
-                               break;
+                               /* fall through */
                        default:
                                *r++ = *p;
                                break;
@@ -792,14 +792,9 @@ static int extension_matches(pval *here, const char *exten, const char *pattern)
                           exten, pattern); */
                        return 1;
                }
-
-
-       } else {
-               if ( strcmp(exten,pattern) == 0 ) {
-                       return 1;
-               } else
-                       return 0;
        }
+
+       return 0;
 }