Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jul 2013 19:24:11 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        gahr@FreeBSD.org
Cc:        tcltk@FreeBSD.org
Subject:   Re: weird problem with git gui
Message-ID:  <51E4222B.8010605@FreeBSD.org>
In-Reply-To: <51E416DF.6040903@FreeBSD.org>
References:  <51E3AD58.6030001@FreeBSD.org> <20130715083241.GB21355@gahrfit.gahr.ch> <51E416DF.6040903@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51E4222B.8010605>