author | Lars Hjemli <hjemli@gmail.com> | 2007-02-03 15:11:41 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-02-04 20:21:46 (UTC) |
commit | ebd7b0fbc378e9beca0b275c5cd9150c930bde56 (patch) (unidiff) | |
tree | 6ee9ef66be06b164732bcc77930b9186c2819da9 | |
parent | bb3e7950c39b67e863a618b3a0e766544b65d3cb (diff) | |
download | cgit-ebd7b0fbc378e9beca0b275c5cd9150c930bde56.zip cgit-ebd7b0fbc378e9beca0b275c5cd9150c930bde56.tar.gz cgit-ebd7b0fbc378e9beca0b275c5cd9150c930bde56.tar.bz2 |
Do not die if tag has no message
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | parsing.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -199,47 +199,47 @@ struct commitinfo *cgit_parse_commit(struct commit *commit) | |||
199 | 199 | ||
200 | 200 | ||
201 | struct taginfo *cgit_parse_tag(struct tag *tag) | 201 | struct taginfo *cgit_parse_tag(struct tag *tag) |
202 | { | 202 | { |
203 | void *data; | 203 | void *data; |
204 | char type[20]; | 204 | char type[20]; |
205 | unsigned long size; | 205 | unsigned long size; |
206 | char *p, *t; | 206 | char *p, *t; |
207 | struct taginfo *ret; | 207 | struct taginfo *ret; |
208 | 208 | ||
209 | data = read_sha1_file(tag->object.sha1, type, &size); | 209 | data = read_sha1_file(tag->object.sha1, type, &size); |
210 | if (!data || strcmp(type, tag_type)) { | 210 | if (!data || strcmp(type, tag_type)) { |
211 | free(data); | 211 | free(data); |
212 | return 0; | 212 | return 0; |
213 | } | 213 | } |
214 | 214 | ||
215 | ret = xmalloc(sizeof(*ret)); | 215 | ret = xmalloc(sizeof(*ret)); |
216 | ret->tagger = NULL; | 216 | ret->tagger = NULL; |
217 | ret->tagger_email = NULL; | 217 | ret->tagger_email = NULL; |
218 | ret->tagger_date = 0; | 218 | ret->tagger_date = 0; |
219 | ret->msg = NULL; | 219 | ret->msg = NULL; |
220 | 220 | ||
221 | p = data; | 221 | p = data; |
222 | 222 | ||
223 | while (p) { | 223 | while (p && *p) { |
224 | if (*p == '\n') | 224 | if (*p == '\n') |
225 | break; | 225 | break; |
226 | 226 | ||
227 | if (!strncmp(p, "tagger ", 7)) { | 227 | if (!strncmp(p, "tagger ", 7)) { |
228 | p += 7; | 228 | p += 7; |
229 | t = strchr(p, '<') - 1; | 229 | t = strchr(p, '<') - 1; |
230 | ret->tagger = substr(p, t); | 230 | ret->tagger = substr(p, t); |
231 | p = t; | 231 | p = t; |
232 | t = strchr(t, '>') + 1; | 232 | t = strchr(t, '>') + 1; |
233 | ret->tagger_email = substr(p, t); | 233 | ret->tagger_email = substr(p, t); |
234 | ret->tagger_date = atol(++t); | 234 | ret->tagger_date = atol(++t); |
235 | } | 235 | } |
236 | p = strchr(p, '\n') + 1; | 236 | p = strchr(p, '\n') + 1; |
237 | } | 237 | } |
238 | 238 | ||
239 | while (p && (*p == '\n')) | 239 | while (p && (*p == '\n')) |
240 | p = strchr(p, '\n') + 1; | 240 | p = strchr(p, '\n') + 1; |
241 | if (p) | 241 | if (p && *p) |
242 | ret->msg = xstrdup(p); | 242 | ret->msg = xstrdup(p); |
243 | free(data); | 243 | free(data); |
244 | return ret; | 244 | return ret; |
245 | } | 245 | } |