|
|
|
@ -4494,14 +4494,19 @@ int ast_context_add_ignorepat2(struct ast_context *con, const char *value, const
|
|
|
|
|
{
|
|
|
|
|
struct ast_ignorepat *ignorepat, *ignorepatc, *ignorepatl = NULL;
|
|
|
|
|
int length;
|
|
|
|
|
char *pattern;
|
|
|
|
|
length = sizeof(struct ast_ignorepat);
|
|
|
|
|
length += strlen(value) + 1;
|
|
|
|
|
if (!(ignorepat = ast_calloc(1, length)))
|
|
|
|
|
return -1;
|
|
|
|
|
/* The cast to char * is because we need to write the initial value.
|
|
|
|
|
* The field is not supposed to be modified otherwise
|
|
|
|
|
* The field is not supposed to be modified otherwise. Also, gcc 4.2
|
|
|
|
|
* sees the cast as dereferencing a type-punned pointer and warns about
|
|
|
|
|
* it. This is the workaround (we're telling gcc, yes, that's really
|
|
|
|
|
* what we wanted to do).
|
|
|
|
|
*/
|
|
|
|
|
strcpy((char *)ignorepat->pattern, value);
|
|
|
|
|
pattern = (char *) ignorepat->pattern;
|
|
|
|
|
strcpy(pattern, value);
|
|
|
|
|
ignorepat->next = NULL;
|
|
|
|
|
ignorepat->registrar = registrar;
|
|
|
|
|
ast_mutex_lock(&con->lock);
|
|
|
|
|