diff options
| -rw-r--r-- | ui-refs.c | 8 |
1 files changed, 7 insertions, 1 deletions
| @@ -103,6 +103,7 @@ static void print_tag_downloads(const struct cgit_repo *repo, const char *ref) | |||
| 103 | const struct cgit_snapshot_format* f; | 103 | const struct cgit_snapshot_format* f; |
| 104 | char *filename; | 104 | char *filename; |
| 105 | const char *basename; | 105 | const char *basename; |
| 106 | int free_ref = 0; | ||
| 106 | 107 | ||
| 107 | if (!ref || strlen(ref) < 2) | 108 | if (!ref || strlen(ref) < 2) |
| 108 | return; | 109 | return; |
| @@ -111,8 +112,10 @@ static void print_tag_downloads(const struct cgit_repo *repo, const char *ref) | |||
| 111 | if (prefixcmp(ref, basename) != 0) { | 112 | if (prefixcmp(ref, basename) != 0) { |
| 112 | if ((ref[0] == 'v' || ref[0] == 'V') && isdigit(ref[1])) | 113 | if ((ref[0] == 'v' || ref[0] == 'V') && isdigit(ref[1])) |
| 113 | ref++; | 114 | ref++; |
| 114 | if (isdigit(ref[0])) | 115 | if (isdigit(ref[0])) { |
| 115 | ref = xstrdup(fmt("%s-%s", basename, ref)); | 116 | ref = xstrdup(fmt("%s-%s", basename, ref)); |
| 117 | free_ref = 1; | ||
| 118 | } | ||
| 116 | } | 119 | } |
| 117 | 120 | ||
| 118 | for (f = cgit_snapshot_formats; f->suffix; f++) { | 121 | for (f = cgit_snapshot_formats; f->suffix; f++) { |
| @@ -122,6 +125,9 @@ static void print_tag_downloads(const struct cgit_repo *repo, const char *ref) | |||
| 122 | cgit_snapshot_link(filename, NULL, NULL, NULL, NULL, filename); | 125 | cgit_snapshot_link(filename, NULL, NULL, NULL, NULL, filename); |
| 123 | html(" "); | 126 | html(" "); |
| 124 | } | 127 | } |
| 128 | |||
| 129 | if (free_ref) | ||
| 130 | free((char *)ref); | ||
| 125 | } | 131 | } |
| 126 | static int print_tag(struct refinfo *ref) | 132 | static int print_tag(struct refinfo *ref) |
| 127 | { | 133 | { |
