X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/03eb76dfad2887127581f5f1b4e2edbe8c4ca5fe..1b1974c45e5e23e5527aa43c4d9ece423a13dfdc:/ui-snapshot.c diff --git a/ui-snapshot.c b/ui-snapshot.c index 42b7489..8f82119 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c @@ -1,7 +1,6 @@ /* ui-snapshot.c: generate snapshot of a commit * - * Copyright (C) 2006 Lars Hjemli - * Copyright (C) 2012 Jason A. Donenfeld + * Copyright (C) 2006-2014 cgit Development Team * * Licensed under GNU General Public License v2 * (see COPYING for full license text) @@ -99,14 +98,9 @@ const struct cgit_snapshot_format cgit_snapshot_formats[] = { static const struct cgit_snapshot_format *get_format(const char *filename) { const struct cgit_snapshot_format *fmt; - int fl, sl; - fl = strlen(filename); 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;