From e3b3c9380ac2118b596829a0cfe142d7e662b2fe Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Mon, 31 May 2010 12:39:06 +0000 Subject: [PATCH] - add pathmunge to /etc/kshrc --- ksh.spec | 5 ++++- kshrc.rhs | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ksh.spec b/ksh.spec index b4919ea..2cb482f 100644 --- a/ksh.spec +++ b/ksh.spec @@ -6,7 +6,7 @@ URL: http://www.kornshell.com/ Group: System Environment/Shells License: CPL Version: 20100309 -Release: 5%{?dist} +Release: 6%{?dist} Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{releasedate}.tgz Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{releasedate}.tgz Source3: kshrc.rhs @@ -107,6 +107,9 @@ fi rm -rf $RPM_BUILD_ROOT %changelog +* Mon May 31 2010 Michal Hlavinka - 20100309-6 +- add pathmunge to /etc/kshrc + * Wed May 05 2010 Michal Hlavinka - 20100309-5 - fix rare cd builtin crash (#578582) diff --git a/kshrc.rhs b/kshrc.rhs index b143224..dcb2e23 100644 --- a/kshrc.rhs +++ b/kshrc.rhs @@ -20,6 +20,21 @@ _src_etc_profile_d() unset i fi } + +pathmunge () { +case ":${PATH}:" in +*:"$1":*) + ;; +*) + if [ "$2" = "after" ]; then + PATH=$PATH:$1 + else + PATH=$1:$PATH + fi +esac +} + _src_etc_profile_d unset -f _src_etc_profile_d +unset -f pathmunge