diff -up gromacs-4.5.1/scripts/GMXRC.bash.cmakein.orig gromacs-4.5.1/scripts/GMXRC.bash.cmakein --- gromacs-4.5.1/scripts/GMXRC.bash.cmakein.orig 2010-08-23 20:58:30.000000000 +0300 +++ gromacs-4.5.1/scripts/GMXRC.bash.cmakein 2010-10-25 17:11:05.955213941 +0300 @@ -8,8 +8,12 @@ tmppath="" for i in `echo $LD_LIBRARY_PATH | sed "s/:/ /g"`; do if test "$i" != "$GMXLDLIB"; then + if test "${tmppath}" == ""; then + tmppath=$i + else tmppath=${tmppath}:$i fi + fi done LD_LIBRARY_PATH=$tmppath @@ -38,6 +42,9 @@ for i in `echo $MANPATH | sed "s/:/ /g"` tmppath=${tmppath}:$i fi done +if test "$tmppath" == ""; then + tmppath=":" +fi MANPATH=$tmppath ########################################################## diff -up gromacs-4.5.1/scripts/GMXRC.bash.in.orig gromacs-4.5.1/scripts/GMXRC.bash.in --- gromacs-4.5.1/scripts/GMXRC.bash.in.orig 2010-08-23 20:58:30.000000000 +0300 +++ gromacs-4.5.1/scripts/GMXRC.bash.in 2010-10-25 17:11:05.955213941 +0300 @@ -8,8 +8,12 @@ tmppath="" for i in `echo $LD_LIBRARY_PATH | sed "s/:/ /g"`; do if test "$i" != "$GMXLDLIB"; then + if test "${tmppath}" == ""; then + tmppath=$i + else tmppath=${tmppath}:$i fi + fi done LD_LIBRARY_PATH=$tmppath @@ -38,6 +42,9 @@ for i in `echo $MANPATH | sed "s/:/ /g"` tmppath=${tmppath}:$i fi done +if test "$tmppath" == ""; then + tmppath=":" +fi MANPATH=$tmppath ########################################################## diff -up gromacs-4.5.1/scripts/GMXRC.csh.cmakein.orig gromacs-4.5.1/scripts/GMXRC.csh.cmakein --- gromacs-4.5.1/scripts/GMXRC.csh.cmakein.orig 2010-08-23 20:58:30.000000000 +0300 +++ gromacs-4.5.1/scripts/GMXRC.csh.cmakein 2010-10-25 17:11:05.955213941 +0300 @@ -16,7 +16,13 @@ if (! $?GMXMAN) setenv GMXMAN "" # remove previous gromacs part from ld_library_path set tmppath = "" foreach i ( `echo $LD_LIBRARY_PATH | sed "s/:/ /g"` ) - if ( "$i" != "$GMXLDLIB" ) set tmppath = "${tmppath}:$i" + if ( "$i" != "$GMXLDLIB" ) then + if ("${tmppath}" == "") then + set tmppath = "$i" + else + set tmppath = "${tmppath}:$i" + endif + endif end setenv LD_LIBRARY_PATH $tmppath @@ -39,6 +45,9 @@ set tmppath = "" foreach i ( `echo $MANPATH | sed "s/:/ /g"` ) if ( "$i" != "$GMXMAN" ) set tmppath = "${tmppath}:$i" end +if ("$tmppath" == "") then + set tmppath = ":" +endif setenv MANPATH $tmppath ########################################################## diff -up gromacs-4.5.1/scripts/GMXRC.csh.in.orig gromacs-4.5.1/scripts/GMXRC.csh.in --- gromacs-4.5.1/scripts/GMXRC.csh.in.orig 2010-08-23 20:58:30.000000000 +0300 +++ gromacs-4.5.1/scripts/GMXRC.csh.in 2010-10-25 17:11:05.955213941 +0300 @@ -16,7 +16,13 @@ if (! $?GMXMAN) setenv GMXMAN "" # remove previous gromacs part from ld_library_path set tmppath = "" foreach i ( `echo $LD_LIBRARY_PATH | sed "s/:/ /g"` ) - if ( "$i" != "$GMXLDLIB" ) set tmppath = "${tmppath}:$i" + if ( "$i" != "$GMXLDLIB" ) then + if ("${tmppath}" == "") then + set tmppath = "$i" + else + set tmppath = "${tmppath}:$i" + endif + endif end setenv LD_LIBRARY_PATH $tmppath @@ -39,6 +45,9 @@ set tmppath = "" foreach i ( `echo $MANPATH | sed "s/:/ /g"` ) if ( "$i" != "$GMXMAN" ) set tmppath = "${tmppath}:$i" end +if ("$tmppath" == "") then + set tmppath = ":" +endif setenv MANPATH $tmppath ########################################################## diff -up gromacs-4.5.1/scripts/GMXRC.zsh.cmakein.orig gromacs-4.5.1/scripts/GMXRC.zsh.cmakein --- gromacs-4.5.1/scripts/GMXRC.zsh.cmakein.orig 2010-08-23 20:58:30.000000000 +0300 +++ gromacs-4.5.1/scripts/GMXRC.zsh.cmakein 2010-10-25 17:11:05.955213941 +0300 @@ -8,8 +8,12 @@ tmppath="" for i in `echo $LD_LIBRARY_PATH | sed "s/:/ /g"`; do if test "$i" != "$GMXLDLIB"; then + if test "${tmppath}" = ""; then + tmppath=$i + else tmppath=${tmppath}:$i fi + fi done LD_LIBRARY_PATH=$tmppath @@ -38,6 +42,9 @@ for i in `echo $MANPATH | sed "s/:/ /g"` tmppath=${tmppath}:$i fi done +if test "$tmppath" = ""; then + tmppath=":" +fi MANPATH=$tmppath ########################################################## diff -up gromacs-4.5.1/scripts/GMXRC.zsh.in.orig gromacs-4.5.1/scripts/GMXRC.zsh.in --- gromacs-4.5.1/scripts/GMXRC.zsh.in.orig 2010-08-23 20:58:30.000000000 +0300 +++ gromacs-4.5.1/scripts/GMXRC.zsh.in 2010-10-25 17:11:05.955213941 +0300 @@ -8,8 +8,12 @@ tmppath="" for i in `echo $LD_LIBRARY_PATH | sed "s/:/ /g"`; do if test "$i" != "$GMXLDLIB"; then + if test "${tmppath}" = ""; then + tmppath=$i + else tmppath=${tmppath}:$i fi + fi done LD_LIBRARY_PATH=$tmppath @@ -38,6 +42,9 @@ for i in `echo $MANPATH | sed "s/:/ /g"` tmppath=${tmppath}:$i fi done +if test "$tmppath" = ""; then + tmppath=":" +fi MANPATH=$tmppath ##########################################################