vcs-svn: use strstr instead of memmem
authorDavid Barr <davidbarr@google.com>
Thu, 31 May 2012 14:41:28 +0000 (00:41 +1000)
committerJonathan Nieder <jrnieder@gmail.com>
Fri, 6 Jul 2012 04:26:52 +0000 (23:26 -0500)
memmem is a GNU extension.

Avoiding it makes the code clearer and makes it easier for projects
that don't share git's compat/ code, such as the standalone
svn-dump-fast-export project, to reuse the vcs-svn/ library.

Signed-off-by: David Barr <davidbarr@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
vcs-svn/fast_export.c
index b4be91cc76e24538c2eb3da963120a44fd4f23a0..854b328d43955f28096533477190a618f9346ae0 100644 (file)
@@ -158,7 +158,7 @@ static int parse_cat_response_line(const char *header, off_t *len)
 
        if (ends_with(header, headerlen, " missing"))
                return error("cat-blob reports missing blob: %s", header);
-       type = memmem(header, headerlen, " blob ", strlen(" blob "));
+       type = strstr(header, " blob ");
        if (!type)
                return error("cat-blob header has wrong object type: %s", header);
        n = strtoumax(type + strlen(" blob "), (char **) &end, 10);