diff --git a/git-compat-util.h b/git-compat-util.h
index 3bcf5b13f2c7bab387b02bd3075629a9d14c5feb..b2e18954c03ff502053cb74d142faab7d2a8dacb 100644 (file)
--- a/git-compat-util.h
+++ b/git-compat-util.h
}
}
+static inline int has_extension(const char *filename, const char *ext)
+{
+ size_t len = strlen(filename);
+ size_t extlen = strlen(ext);
+ return len > extlen && !memcmp(filename + len - extlen, ext, extlen);
+}
+
/* Sane ctype - no locale, and works with signed chars */
#undef isspace
#undef isdigit