when amending rpath don't add empty rpath entries

This commit is contained in:
Jörg Thalheim
2021-08-28 08:29:40 +02:00
parent 354dd23ed4
commit 52a5bb061a

View File

@@ -1459,12 +1459,14 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op,
if (!rpath) { if (!rpath) {
debug("no RPATH to shrink\n"); debug("no RPATH to shrink\n");
return; return;
} ;}
newRPath = shrinkRPath(rpath, neededLibs, allowedRpathPrefixes); newRPath = shrinkRPath(rpath, neededLibs, allowedRpathPrefixes);
break; break;
} }
case rpAdd: { case rpAdd: {
newRPath = std::string(rpath ? rpath : "") + ":" + newRPath; auto temp = std::string(rpath ? rpath : "");
appendRPath(temp, newRPath);
newRPath = temp;
break; break;
} }
case rpSet: { break; } /* new rpath was provied as input to this function */ case rpSet: { break; } /* new rpath was provied as input to this function */