diff options
author | dgp <dgp@users.sourceforge.net> | 2000-12-11 04:17:38 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2000-12-11 04:17:38 (GMT) |
commit | ab4eb3fe6a6e7f494057f9bc9af0c1a4489c5f88 (patch) | |
tree | 3558459e0bea4593330821ed820ea77f36f43326 /library/msgcat/msgcat.tcl | |
parent | 19df5d993a9f6e55e773ea93d3632c770756358b (diff) | |
download | tcl-ab4eb3fe6a6e7f494057f9bc9af0c1a4489c5f88.zip tcl-ab4eb3fe6a6e7f494057f9bc9af0c1a4489c5f88.tar.gz tcl-ab4eb3fe6a6e7f494057f9bc9af0c1a4489c5f88.tar.bz2 |
2000-12-10 Don Porter <dgp@users.sourceforge.net>
* library/init.tcl:
* library/msgcat/msgcat.tcl:
* library/msgcat/pkgIndex.tcl:
* library/opt/optparse.tcl:
* library/opt/pkgIndex.tcl: Where [uplevel] is used in a proc
to evaluate a Tcl built-in command in the caller's context,
the built-in commands are now fully namespace-qualified. This
prevents problems when the caller context is in a namespace where
the built-in command name has been used by a command in the
namespace. (For example, [::ns::set] might be called instead
of the intended [::set]). [Bug #119422, Patch #102545]
Diffstat (limited to 'library/msgcat/msgcat.tcl')
-rw-r--r-- | library/msgcat/msgcat.tcl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl index c4c4d81..27c4c57 100644 --- a/library/msgcat/msgcat.tcl +++ b/library/msgcat/msgcat.tcl @@ -10,9 +10,9 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: msgcat.tcl,v 1.9 2000/08/11 00:45:32 ericm Exp $ +# RCS: @(#) $Id: msgcat.tcl,v 1.10 2000/12/11 04:17:38 dgp Exp $ -package provide msgcat 1.2 +package provide msgcat 1.2.1 namespace eval msgcat { namespace export mc mcset mcmset mclocale mcpreferences mcunknown mcmax @@ -49,7 +49,7 @@ proc msgcat::mc {src args} { # Check for the src in each namespace starting from the local and # ending in the global. - set ns [uplevel {namespace current}] + set ns [uplevel 1 [list ::namespace current]] while {$ns != ""} { foreach loc $::msgcat::loclist { @@ -66,7 +66,7 @@ proc msgcat::mc {src args} { set ns [namespace parent $ns] } # we have not found the translation - return [uplevel 1 [list [namespace origin mcunknown] \ + return [uplevel 1 [list [::namespace origin mcunknown] \ $::msgcat::locale $src] $args] } @@ -136,7 +136,7 @@ proc msgcat::mcload {langdir} { incr x set fid [open $langfile "r"] fconfigure $fid -encoding utf-8 - uplevel [list eval [read $fid]] + uplevel 1 [read $fid] close $fid } } @@ -161,7 +161,7 @@ proc msgcat::mcset {locale src {dest ""}} { set dest $src } - set ns [uplevel {namespace current}] + set ns [uplevel 1 [list ::namespace current]] set ::msgcat::msgs([string tolower $locale],$ns,$src) $dest return $dest @@ -186,7 +186,7 @@ proc msgcat::mcmset {locale pairs } { } set locale [string tolower $locale] - set ns [uplevel {namespace current}] + set ns [uplevel 1 [list ::namespace current]] foreach {src dest} $pairs { set ::msgcat::msgs($locale,$ns,$src) $dest |