Merge branch 'mr/doc-clean-f-f'
[gitweb.git] / builtin / ls-remote.c
index 39e5144b9e38f1319f8fb881af6b1d34ad0c4089..4554dbc8a98c0daaa67c8ea65f5ddf5c48f19383 100644 (file)
@@ -5,7 +5,7 @@
 
 static const char ls_remote_usage[] =
 "git ls-remote [--heads] [--tags]  [-u <exec> | --upload-pack <exec>]\n"
-"                     [-q|--quiet] [--exit-code] [--get-url] [<repository> [<refs>...]]";
+"                     [-q | --quiet] [--exit-code] [--get-url] [<repository> [<refs>...]]";
 
 /*
  * Is there one among the list of patterns that match the tail part
@@ -22,7 +22,7 @@ static int tail_match(const char **pattern, const char *path)
        if (snprintf(pathbuf, sizeof(pathbuf), "/%s", path) > sizeof(pathbuf))
                return error("insanely long ref %.*s...", 20, path);
        while ((p = *(pattern++)) != NULL) {
-               if (!fnmatch(p, pathbuf, 0))
+               if (!wildmatch(p, pathbuf, 0, NULL))
                        return 1;
        }
        return 0;
@@ -92,7 +92,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
 
        if (argv[i]) {
                int j;
-               pattern = xcalloc(sizeof(const char *), argc - i + 1);
+               pattern = xcalloc(argc - i + 1, sizeof(const char *));
                for (j = i; j < argc; j++) {
                        int len = strlen(argv[j]);
                        char *p = xmalloc(len + 3);