From: Bruno Haible Date: Mon, 1 Jul 2024 11:26:43 +0000 (+0200) Subject: msgunfmt: Fix msgunfmt-tcl-1 failure with tcl version 9.0 beta2. X-Git-Tag: v0.23~254 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc4bb93e17dd7be6c75e419b408d8fead1710f1d;p=thirdparty%2Fgettext.git msgunfmt: Fix msgunfmt-tcl-1 failure with tcl version 9.0 beta2. Reported by Jeffrey Cliff in . * gettext-tools/src/msgunfmt.tcl: Access the ::msgcat::header variable through an absolute name syntax, not a relative name syntax. Rationale: says: "In Tcl 8 variable names that are not absolute are resolved by looking first in the current namespace, and then in the global namespace. In Tcl 9 such variables are always interpreted as relative to the current namespace." --- diff --git a/gettext-tools/src/msgunfmt.tcl b/gettext-tools/src/msgunfmt.tcl index 32e79cd24..ef3211247 100644 --- a/gettext-tools/src/msgunfmt.tcl +++ b/gettext-tools/src/msgunfmt.tcl @@ -1,5 +1,5 @@ # Reading tcl/msgcat .msg files. -# Copyright (C) 2002 Free Software Foundation, Inc. +# Copyright (C) 2002-2024 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -57,7 +57,7 @@ proc msgcat::mcdump {langfile} { # msgunfmt expects the output in UTF-8 encoding. fconfigure stdout -encoding utf-8 - set msgcat::header "" + set ::msgcat::header "" set fd [open $langfile r] # In newer tcl versions, the .msg files are in UTF-8 encoding. @@ -65,11 +65,11 @@ proc msgcat::mcdump {langfile} { eval [read $fd] close $fd - if {$msgcat::header == ""} { + if {$::msgcat::header == ""} { # Provide a minimal header. - set msgcat::header [subst "MIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n"] + set ::msgcat::header [subst "MIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n"] } - msgcat::write_po_message "" $msgcat::header + msgcat::write_po_message "" $::msgcat::header } else { # Tell msgunfmt to emit an internationalized error message. exit 2