Fix setting paths on old bash.
authorIain Patterson <me@iain.cx>
Fri, 18 Sep 2009 15:04:14 +0000 (16:04 +0100)
committerIain Patterson <me@iain.cx>
Fri, 18 Sep 2009 15:05:08 +0000 (16:05 +0100)
Prevent bash 2 from segfaulting when considering directories in
PATH.bashrc.

.profile.d/PATH.bashrc

index 0528314..ab57aaa 100644 (file)
@@ -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%%/}"