You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
errlogSevPrintf(errlogMajor, "malloc error for creating linked list node");
245
-
ret=1;
246
-
break;
247
-
}
248
-
new->item_str=strdup(argv[i]);
249
-
if (new->item_str==NULL) {
250
-
errlogSevPrintf(errlogMinor, "strdup error for copying %s to new->item_str from addReccasterExcludePattern\n", argv[i]);
251
-
free(new); /* frees if strdup fails */
252
-
ret=1;
253
-
break;
254
-
}
255
-
ellAdd(&self->exclude_patterns, &new->node);
229
+
intdup=0;
230
+
ELLNODE*cur=ellFirst(&self->exclude_patterns);
231
+
while (cur!=NULL) {
232
+
string_list_t*temp= (string_list_t*)cur;
233
+
if (strcmp(argv[i], temp->item_str) ==0) {
234
+
dup=1;
235
+
break;
256
236
}
237
+
cur=ellNext(cur);
257
238
}
258
-
}
259
-
260
-
if (ret) {
261
-
errlogSevPrintf(errlogMajor, "Error in addReccasterExcludePattern - exclude patterns may not be set\n");
239
+
if (dup) {
240
+
errlogSevPrintf(errlogMinor, "Duplicate pattern %s in addReccasterExcludePattern\n", argv[i]);
241
+
continue;
242
+
}
243
+
string_list_t*new=malloc(sizeof(string_list_t));
244
+
if (new==NULL) {
245
+
errlogSevPrintf(errlogMajor, "Error in addReccasterExcludePattern - malloc error for creating linked list node");
246
+
break;
247
+
}
248
+
new->item_str=strdup(argv[i]);
249
+
if (new->item_str==NULL) {
250
+
errlogSevPrintf(errlogMajor, "Error in addReccasterExcludePattern - strdup error for copying %s to new->item_str from addReccasterExcludePattern\n", argv[i]);
0 commit comments