vcs-svn: use strstr instead of memmem
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>
David Barr committed
Jun 1, 2012 at 00:41 UTC
53153e8382966e35362d072ba17ba5887e3c0851
1 file changed
+1
-1
vcs-svn/fast_export.c
+1
-1
@@ -158,7 +158,7 @@ static int parse_cat_response_line(const char *header, off_t *len)
158
159
if (ends_with(header, headerlen, " missing"))
160
return error("cat-blob reports missing blob: %s", header);
161
- type = memmem(header, headerlen, " blob ", strlen(" blob "));
161
+ type = strstr(header, " blob ");
162
if (!type)
163
return error("cat-blob header has wrong object type: %s", header);
164
n = strtoumax(type + strlen(" blob "), (char **) &end, 10);