git-tag: Fix -l option to use better shell style globs.
[gitweb.git] / builtin-tag.c
index d6d38ad123cb0f354a6bd7007eddf8fb1b4d126c..348919cff8645c81ac803a34c967ba34f9b982b4 100644 (file)
@@ -123,22 +123,15 @@ static int show_reference(const char *refname, const unsigned char *sha1,
 static int list_tags(const char *pattern, int lines)
 {
        struct tag_filter filter;
-       char *newpattern;
 
        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);
 
-       free(newpattern);
-
        return 0;
 }