static const ElfW(Versym) kVersymNotNeeded = 0;
static const ElfW(Versym) kVersymGlobal = 1;
+static const char* const kZipFileSeparator = "!/";
static const char* const* g_default_ld_paths;
static std::vector<std::string> g_ld_library_paths;
// 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
// "bar/bas/x.so" within "foo.zip".
- const char* separator = strstr(path, "!/");
+ const char* separator = strstr(path, kZipFileSeparator);
if (separator == nullptr) {
return -1;
}
}
int fd = -1;
- if (strchr(buf, '!') != nullptr) {
+ if (strstr(buf, kZipFileSeparator) != nullptr) {
fd = open_library_in_zipfile(buf, file_offset);
}
// If the name contains a slash, we should attempt to open it directly and not search the paths.
if (strchr(name, '/') != nullptr) {
- if (strchr(name, '!') != nullptr) {
+ if (strstr(name, kZipFileSeparator) != nullptr) {
int fd = open_library_in_zipfile(name, file_offset);
if (fd != -1) {
return fd;