From 524f1f1efe0cb32714c61e26f21701ac952b9e42 Mon Sep 17 00:00:00 2001 From: Dmitriy Ivanov Date: Tue, 9 Jun 2015 13:46:51 -0700 Subject: Make path to apk compliant with jar url format Bug: http://b/21726698 Bug: http://b/8076853 Change-Id: I8c1942a98fe3119746b4dc9f60a7ff215ea7009c --- linker/linker.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'linker') diff --git a/linker/linker.cpp b/linker/linker.cpp index 5aabacc..ce57b28 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -1096,11 +1096,11 @@ static int open_library_in_zipfile(const char* const path, off64_t* file_offset) { TRACE("Trying zip file open from path '%s'", path); - // Treat an '!' character inside a path as the separator between the name + // Treat an '!/' separator inside a path as the separator between the name // of the zip file on disk and the subdirectory to search within it. - // For example, if path is "foo.zip!bar/bas/x.so", then we search for + // For example, if path is "foo.zip!/bar/bas/x.so", then we search for // "bar/bas/x.so" within "foo.zip". - const char* separator = strchr(path, '!'); + const char* separator = strstr(path, "!/"); if (separator == nullptr) { return -1; } @@ -1114,7 +1114,7 @@ static int open_library_in_zipfile(const char* const path, buf[separator - path] = '\0'; const char* zip_path = buf; - const char* file_path = &buf[separator - path + 1]; + const char* file_path = &buf[separator - path + 2]; int fd = TEMP_FAILURE_RETRY(open(zip_path, O_RDONLY | O_CLOEXEC)); if (fd == -1) { return -1; -- cgit v1.1