From 0022b1a8c3238ee7350d19b93ac9816e66405cc3 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Fri, 18 Sep 2009 16:04:14 +0100 Subject: [PATCH] Fix setting paths on old bash. Prevent bash 2 from segfaulting when considering directories in PATH.bashrc. --- .profile.d/PATH.bashrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.profile.d/PATH.bashrc b/.profile.d/PATH.bashrc index 0528314..ab57aaa 100644 --- a/.profile.d/PATH.bashrc +++ b/.profile.d/PATH.bashrc @@ -91,8 +91,8 @@ function makepath() { # Construct directory list, omitting nonexistent and undefined ones. dirs= -for dir in ${SYSTEM:-#}/${ARCHITECTURE:-#} ${SYSTEM:-} ""; do - [ "${dir/#/}" = "$dir" ] || continue +for dir in "${SYSTEM:-@}/${ARCHITECTURE:-@}" "${SYSTEM:-@}" ""; do + [ "${dir/@/}" = "$dir" ] || continue [ -d "$DIR/$dir" ] || continue dirs="$dirs,$DIR/$dir" dirs="${dirs%%/}" -- 2.7.4