5 ms·
How to safely prepend a directory to a PATH-like variable (in any POSIX-compliant shell): export LD_LIBRARY_PATH=/opt/whatever/lib${LD_LIBRARY_PATH:+:$LD_LIBRA
by anderskaseorg 9y ago
How to safely prepend a directory to a PATH-like variable (in any POSIX-compliant shell):
export LD_LIBRARY_PATH=/opt/whatever/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
Pull request sent to https://github.com/torch/distro/pull/228 https://github.com/torch/distro/pull/228.
- djsumdog 9y agoGood fix and good for sending them a merge request. I still find it kinda baffling glibc would have this behavior for a trailing colon (:). Like, I know it's probably legacy/comparability, but it feels like a security nightmare. ./ should be explicit, not implicit.
- emmelaich 9y agoAlso for leading colons. (but you probably knew that)