]> git.ipfire.org Git - thirdparty/git.git/blobdiff - vcs-svn/fast_export.c
strbuf: introduce starts_with() and ends_with()
[thirdparty/git.git] / vcs-svn / fast_export.c
index f2b23c81de11a63c2c1c2ac925be9081ad5bea5c..bd0f2c2b86847708e5ebe668773f0fd08b9efc5d 100644 (file)
@@ -162,22 +162,13 @@ static void die_short_read(struct line_buffer *input)
        die("invalid dump: unexpected end of file");
 }
 
-static int ends_with(const char *s, size_t len, const char *suffix)
-{
-       const size_t suffixlen = strlen(suffix);
-       if (len < suffixlen)
-               return 0;
-       return !memcmp(s + len - suffixlen, suffix, suffixlen);
-}
-
 static int parse_cat_response_line(const char *header, off_t *len)
 {
-       size_t headerlen = strlen(header);
        uintmax_t n;
        const char *type;
        const char *end;
 
-       if (ends_with(header, headerlen, " missing"))
+       if (ends_with(header, " missing"))
                return error("cat-blob reports missing blob: %s", header);
        type = strstr(header, " blob ");
        if (!type)