Carlos Rica <jasampler@xxxxxxxxx> writes: > if (pattern == NULL) > - pattern = ""; > + pattern = "*"; > > - /* prepend/append * to the shell pattern: */ > - newpattern = xmalloc(strlen(pattern) + 3); > - sprintf(newpattern, "*%s*", pattern); > - > - filter.pattern = newpattern; > + filter.pattern = pattern; > filter.lines = lines; > > for_each_tag_ref(show_reference, (void *) &filter); I think it is conceptually simpler on the show_reference side to allow (filter.pattern == NULL) and say: if (!filter->pattern || !fnmatch(filter->pattern, refname, 0)) { ... show that ref ... } It is not such a big deal now you do not do newpattern allocation anymore, so I'll apply the patch as is. - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html