case '{': /* quantifier {n[,m]} */
{
- char *comma;
+ char *comma=NULL;
int cpos;
where=strchr(pattern,'}');
if (where) {
@@ -636,11 +634,10 @@
}
prev = *tmp;
if (i >= from || !from) { /* if found */
+ int l = strlen(groupdata) - strlen(data);
if (option_debug)
ast_log(LOG_DEBUG, " >>>> found '%s' in data '%s' after %d runs\n", group, data, i);
- char name[16];
data = data + (i * (strlen(group)- 1)) - 1;
- int l = strlen(groupdata) - strlen(data);
/* data = data-i+from-1; */ /* possible failure here! */
if (prev == ')') { /* grouping => capture */
*(group+strlen(group)-1) = '\0';
@@ -708,7 +705,7 @@
s = scopy = (char *) malloc(strlen(pattern));
sepcopy = (char *) malloc(strlen(pattern));
strcpy(s,group);
- while (sep = strsep(&s,"|")) {
+ while ((sep = strsep(&s,"|"))) {
strcpy(sepcopy,sep);
strcat(sepcopy,pattern+border+1);
if (option_debug)
@@ -737,7 +734,6 @@
return 0;
} else {
if (pattern[1] != '{') { /* capture without quantifiers */
- char name[16];
int l = strlen(groupdata) - strlen(data);
groupdata[l-1] = '\0';
*(group+strlen(group)-1) = '\0';
@@ -810,7 +806,7 @@
}
/* try exactly num repetitions, from high to from */
-int ast_extension_patmatch_repeated(const char *pattern, char *data, const int num)
+static int ast_extension_patmatch_repeated(const char *pattern, const char *data, const int num)
{
int i;
ast_log(LOG_DEBUG, " >>> try %d repetitions of '%s' in data '%s'\n", num, pattern, data);
@@ -848,7 +844,7 @@
static int extension_close(char *pattern, char *data, int needmore)
{
- int match;
+ int match=1;
/* If "data" is longer, it can'be a subset of pattern unless
pattern is a pattern match */
if ((strlen(pattern) < strlen(data)) && (pattern[0] != '_'))
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum