Opened 13 years ago

Last modified 11 years ago

#30584 closed enhancement

setupenv.bash misses to declare some variables as local, cluttering shell env — at Version 1

Reported by: mp@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 2.1.0
Component: base Version: 2.0.1
Keywords: Cc:
Port:

Description (last modified by jmroot (Joshua Root))

Simple fix:

--- setupenv.bash.orig  2011-08-03 23:14:52.000000000 +0200
+++ setupenv.bash       2011-08-03 23:13:11.000000000 +0200
@@ -32,8 +32,9 @@
 function export_path() {
     local binpath="/opt/local/bin"
     local sbinpath="/opt/local/sbin"
-
     local IFS=":"
+    local p
+
     for p in $PATH; do
         if [ "$p" == "$binpath" ]; then
             binpath=""
@@ -54,13 +55,14 @@
 }
 
 function export_manpath() {
-    mpath="/opt/local/share/man"
+    local mpath="/opt/local/share/man"
+    local IFS=":"
+    local p
 
     if [ -z "$MANPATH" ]; then
         return
     fi
 
-    local IFS=":"
     for p in $MANPATH; do
         if [ "$p" == "$mpath" ]; then
             mpath=""

Change History (1)

comment:1 Changed 13 years ago by jmroot (Joshua Root)

Description: modified (diff)

Please remember to use WikiFormatting, or better, just add patches as attachments.

Note: See TracTickets for help on using tickets.