]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 14 Nov 2007 15:16:03 +0000 (15:16 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 14 Nov 2007 15:16:03 +0000 (15:16 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6255 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_regex.c

index e1a2538d2fddf7b730a5af01362e9f1af504dd66..4dbc7727e04ea7a0f42df8ce50be8d3ce1716bef 100644 (file)
@@ -68,12 +68,14 @@ SWITCH_DECLARE(int) switch_regex_perform(const char *field, const char *expressi
                return 0;
        }
 
-       if (*expression == '/' && *(expression + (strlen(expression) - 1)) == '/') {
+       if (*expression == '/') {
                char *opts = NULL;
                tmp = strdup(expression + 1);
                assert(tmp);
                if ((opts = strrchr(tmp, '/'))) {
                        *opts++ = '\0';
+               } else {
+                       goto end;
                }
                expression = tmp;
                if (opts) {
@@ -86,6 +88,7 @@ SWITCH_DECLARE(int) switch_regex_perform(const char *field, const char *expressi
                }
        }
 
+
        re = pcre_compile(expression,   /* the pattern */
                                          flags,                /* default options */
                                          &error,       /* for error message */