X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-compat-util.h;h=cf89cdf4598b3796724a85aa707f740245155cdc;hb=fc721b699b817e9cb78994c6dd6d86e744bd2112;hp=8c7e11473390c14956e43843c17a2d85a336a087;hpb=abce32b5ba5cf91c85b032d2dbb2702679a5608e;p=git.git diff --git a/git-compat-util.h b/git-compat-util.h index 8c7e11473..cf89cdf45 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -157,6 +157,12 @@ extern void set_warn_routine(void (*routine)(const char *warn, va_list params)); extern int prefixcmp(const char *str, const char *prefix); extern time_t tm_to_time_t(const struct tm *tm); +static inline const char *skip_prefix(const char *str, const char *prefix) +{ + size_t len = strlen(prefix); + return strncmp(str, prefix, len) ? NULL : str + len; +} + #ifdef NO_MMAP #ifndef PROT_READ