diff options
Diffstat (limited to 'parsing.c')
-rw-r--r-- | parsing.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -147,25 +147,25 @@ struct commitinfo *cgit_parse_commit(struct commit *commit) | |||
147 | if (p == NULL) | 147 | if (p == NULL) |
148 | return ret; | 148 | return ret; |
149 | 149 | ||
150 | if (prefixcmp(p, "tree ")) | 150 | if (!starts_with(p, "tree ")) |
151 | die("Bad commit: %s", sha1_to_hex(commit->object.sha1)); | 151 | die("Bad commit: %s", sha1_to_hex(commit->object.sha1)); |
152 | else | 152 | else |
153 | p += 46; // "tree " + hex[40] + "\n" | 153 | p += 46; // "tree " + hex[40] + "\n" |
154 | 154 | ||
155 | while (!prefixcmp(p, "parent ")) | 155 | while (starts_with(p, "parent ")) |
156 | p += 48; // "parent " + hex[40] + "\n" | 156 | p += 48; // "parent " + hex[40] + "\n" |
157 | 157 | ||
158 | if (p && !prefixcmp(p, "author ")) { | 158 | if (p && starts_with(p, "author ")) { |
159 | p = parse_user(p + 7, &ret->author, &ret->author_email, | 159 | p = parse_user(p + 7, &ret->author, &ret->author_email, |
160 | &ret->author_date); | 160 | &ret->author_date); |
161 | } | 161 | } |
162 | 162 | ||
163 | if (p && !prefixcmp(p, "committer ")) { | 163 | if (p && starts_with(p, "committer ")) { |
164 | p = parse_user(p + 10, &ret->committer, &ret->committer_email, | 164 | p = parse_user(p + 10, &ret->committer, &ret->committer_email, |
165 | &ret->committer_date); | 165 | &ret->committer_date); |
166 | } | 166 | } |
167 | 167 | ||
168 | if (p && !prefixcmp(p, "encoding ")) { | 168 | if (p && starts_with(p, "encoding ")) { |
169 | p += 9; | 169 | p += 9; |
170 | t = strchr(p, '\n'); | 170 | t = strchr(p, '\n'); |
171 | if (t) { | 171 | if (t) { |
@@ -244,7 +244,7 @@ struct taginfo *cgit_parse_tag(struct tag *tag) | |||
244 | if (*p == '\n') | 244 | if (*p == '\n') |
245 | break; | 245 | break; |
246 | 246 | ||
247 | if (!prefixcmp(p, "tagger ")) { | 247 | if (starts_with(p, "tagger ")) { |
248 | p = parse_user(p + 7, &ret->tagger, &ret->tagger_email, | 248 | p = parse_user(p + 7, &ret->tagger, &ret->tagger_email, |
249 | &ret->tagger_date); | 249 | &ret->tagger_date); |
250 | } else { | 250 | } else { |