if (appPaths.back() == ':')
appPaths.pop_back();
- auto convert = [&appPaths, enableR2R, isAppNI](const std::string& path, const char* name) {
+ std::vector<std::string> tpaAssemblies;
+ splitPath(__tpa, tpaAssemblies);
+
+ auto convert = [&appPaths, enableR2R, isAppNI, tpaAssemblies](const std::string& path, const char* name) {
if (isAppNI) {
std::string assembly = path.substr(path.rfind('/') + 1);
- if (strstr(replaceAll(__tpa, ".ni.dll", ".dll").c_str(), assembly.c_str()) != NULL) {
+ bool isExist = false;
+ for (auto& tpa : tpaAssemblies) {
+ if (!strcmp(replaceAll(tpa, ".ni.dll", ".dll").c_str(), assembly.c_str())) {
+ isExist = true;
+ break;
+ }
+ }
+ if (isExist) {
fprintf(stderr, "%s present in the TPA list skips generation of NI file.\n", path.c_str());
return;
}
for (int i = 0; i < count; i++) {
scanFilesInDir(rootPaths[i], convert, 1);
}
+
+ tpaAssemblies.clear();
}
ni_error_e createNiUnderPkgRoot(const std::string& pkgId, bool enableR2R)
return NI_ERROR_NONE;
} else {
std::string assembly = dllPath.substr(dllPath.rfind('/') + 1);
- if (strstr(replaceAll(__tpa, ".ni.dll", ".dll").c_str(), assembly.c_str()) != NULL) {
+ std::vector<std::string> tpaAssemblies;
+ splitPath(__tpa, tpaAssemblies);
+ bool isExist = false;
+ for (auto& tpa : tpaAssemblies) {
+ if (!strcmp(replaceAll(tpa, ".ni.dll", ".dll").c_str(), assembly.c_str())) {
+ isExist = true;
+ break;
+ }
+ }
+ tpaAssemblies.clear();
+ if (isExist) {
fprintf(stderr, "%s present in the TPA list skips generation of NI file.\n", dllPath.c_str());
return NI_ERROR_NONE;
} else {