forked from qt-creator/qt-creator
Environment: Do not leave stray ':' in LD_LIBRARY_PATH
A empty path segment in LD_LIBRARY_PATH is *not* ignored and treated as '.' IIRC. So make sure to not leave a ':' in first place of LD_LIBRARY_PATH or set an empty LD_LIBRARY_PATH on Linux. Change-Id: I99ec2e333c6c0205334daf14ac6a2373c6e465ad Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -49,8 +49,10 @@ public:
|
||||
toReplace.append(':');
|
||||
toReplace.append(lib.path());
|
||||
|
||||
if (ldLibraryPath.startsWith(toReplace))
|
||||
set("LD_LIBRARY_PATH", ldLibraryPath.remove(0, toReplace.length()));
|
||||
if (ldLibraryPath.startsWith(toReplace + ':'))
|
||||
set("LD_LIBRARY_PATH", ldLibraryPath.remove(0, toReplace.length() + 1));
|
||||
else if (ldLibraryPath == toReplace)
|
||||
unset("LD_LIBRARY_PATH");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user