summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f04b8d5)
Use suffixcmp() from Git instead of reimplementing it. This is a
preparation for moving to ends_with() in Git 1.8.6.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
static const struct cgit_snapshot_format *get_format(const char *filename)
{
const struct cgit_snapshot_format *fmt;
static const struct cgit_snapshot_format *get_format(const char *filename)
{
const struct cgit_snapshot_format *fmt;
for (fmt = cgit_snapshot_formats; fmt->suffix; fmt++) {
for (fmt = cgit_snapshot_formats; fmt->suffix; fmt++) {
- sl = strlen(fmt->suffix);
- if (sl >= fl)
- continue;
- if (!strcmp(fmt->suffix, filename + fl - sl))
+ if (!suffixcmp(filename, fmt->suffix))
return fmt;
}
return NULL;
return fmt;
}
return NULL;