From: Iain Patterson Date: Fri, 18 Sep 2009 15:04:14 +0000 (+0100) Subject: Fix setting paths on old bash. X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=0022b1a8c3238ee7350d19b93ac9816e66405cc3;p=profile.git Fix setting paths on old bash. Prevent bash 2 from segfaulting when considering directories in PATH.bashrc. --- 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%%/}"