From owner-freebsd-tcltk@FreeBSD.ORG Mon Jul 15 16:25:09 2013 Return-Path: Delivered-To: tcltk@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ABE83F9E; Mon, 15 Jul 2013 16:25:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C32FE854; Mon, 15 Jul 2013 16:25:08 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA16915; Mon, 15 Jul 2013 19:25:07 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1UylaE-000Gsr-Ua; Mon, 15 Jul 2013 19:25:06 +0300 Message-ID: <51E4222B.8010605@FreeBSD.org> Date: Mon, 15 Jul 2013 19:24:11 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130708 Thunderbird/17.0.7 MIME-Version: 1.0 To: gahr@FreeBSD.org Subject: Re: weird problem with git gui References: <51E3AD58.6030001@FreeBSD.org> <20130715083241.GB21355@gahrfit.gahr.ch> <51E416DF.6040903@FreeBSD.org> In-Reply-To: <51E416DF.6040903@FreeBSD.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: tcltk@FreeBSD.org X-BeenThere: freebsd-tcltk@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD-specific Tcl/Tk discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2013 16:25:09 -0000 on 15/07/2013 18:35 Andriy Gapon said the following: [snip] > I do not have any conclusions or solution, but i have some further observations. > It seems that in my environment tcl wants to manipulate 'environ' global > variable directly instead of using putenv/setenv/tec. I am not sure why this is > preferred, but unix/tclUnixPort.h defines USE_PUTENV only for __CYGWIN__ or APPLE. [snip] > > ... and now I also know why I have this problem on this particular machine! > I have a patched version of libfreetype (print/freetype2 with custom > 'infinality' patch). So apparently the unmodified version does not call setenv > and so tcl has full control. On the other hand with my version setenv confuses tcl. > > I think that in general we should allow setenv to be called from beyond tcl > control even while under tcl interpreter. So I consider this to be an exotic > bug in tcl. Not sure how to proceed from here though. > This patch seems to help me: --- unix/tclUnixPort.h.orig 2012-06-26 22:29:18.000000000 +0300 +++ unix/tclUnixPort.h 2013-07-15 19:19:59.609561609 +0300 @@ -115,6 +115,10 @@ # define TclOSstat stat # define TclOSlstat lstat #endif +#ifdef __FreeBSD__ +# define USE_PUTENV 1 +# define USE_PUTENV_FOR_UNSET 1 +#endif /* *--------------------------------------------------------------------------- --- generic/tclEnv.c.orig 2012-06-26 22:29:18.000000000 +0300 +++ generic/tclEnv.c 2013-07-15 19:20:15.441564839 +0300 @@ -395,7 +395,7 @@ * that no = should be included, and Windows requires it. */ -#if defined(__WIN32__) || defined(__CYGWIN__) +#if defined(__WIN32__) || defined(__CYGWIN__) || defined(__FreeBSD__) string = ckalloc(length + 2); memcpy(string, name, (size_t) length); string[length] = '='; -- Andriy Gapon