From 49ca38001e313d373e5097cb203c5adca6f9a708 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 6 Jun 2018 15:18:11 +0300 Subject: .profile: don't add paths with : in them to PATH --- %HOME%/.profile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to '%HOME%/.profile') diff --git a/%HOME%/.profile b/%HOME%/.profile index ad04911..6c508b2 100644 --- a/%HOME%/.profile +++ b/%HOME%/.profile @@ -12,6 +12,10 @@ fi path_export() { local path for path; do + # Don't add paths with colons in them: + case "$path" in + *:*) continue ;; + esac case "${PATH-}" in "$path") continue ;; *":$path") continue ;; @@ -55,9 +59,7 @@ python_setup() { command -v "$python" > /dev/null 2>&1 \ && user_base="$( "$python" -m site --user-base )" \ && [ -d "$user_base/bin" ] \ - && path_export "$user_base/bin" \ - && continue - break + && path_export "$user_base/bin" done } -- cgit v1.2.3