Skip to content
Permalink
Browse files

When invoking the editor in the edit action, restore the entire start…

…-time environment,

as the editor may want things from it, like TERM.

Thanks for testing, Joe Auty!

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@14564 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
jdberry committed Oct 11, 2005
1 parent 214c19a commit 0bfa671f3729a68d1bc76117c70b749c5db354e2
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/port/port.tcl
@@ -2,7 +2,7 @@
#\
exec @TCLSH@ "$0" "$@"
# port.tcl
# $Id: port.tcl,v 1.121 2005/10/11 20:09:47 jberry Exp $
# $Id: port.tcl,v 1.122 2005/10/11 20:17:42 jberry Exp $
#
# Copyright (c) 2004 Robert Shaw <rshaw@opendarwin.org>
# Copyright (c) 2002 Apple Computer, Inc.
@@ -1740,11 +1740,16 @@ switch -- $action {
}

ed - edit {
# Restore our entire environment from start time
# We need it to evaluate the editor, and the editor
# may want stuff from it as well, like TERM.
array set env [array get boot_env]

# Find an editor to edit the portfile
set editor ""
foreach ed { VISUAL EDITOR } {
if {[info exists boot_env($ed)]} {
set editor $boot_env($ed)
if {[info exists env($ed)]} {
set editor $env($ed)
}
}

0 comments on commit 0bfa671

Please sign in to comment.
You can’t perform that action at this time.