[ROOT] gSystem->Unsetenv

From: Nicolas Produit (Nicolas.Produit@obs.unige.ch)
Date: Sat Jan 19 2002 - 11:34:31 MET


Hi,
In my version of root (3.00/06 on linux)
gSystem->Unsetenv("A") is crashing.
I saw that this was a known feature and was corrected.
But looking at you code it seems that
Unsetenv("A") is coded like Setenv("A","").
This is not exactely a unsetenv. After an unsetenv the
environment variable must disapear rather then be rest to a null string.

isdcpc3:dal3cat 173> root
   *******************************************
   *                                         *
   *        W E L C O M E  to  R O O T       *
   *                                         *
   *   Version   3.00/06       10 May 2001   *
   *                                         *
   *  You are welcome to visit our Web site  *
   *          http://root.cern.ch            *
   *                                         *
   *******************************************

FreeType Engine v1.x used to render TrueType fonts.
Compiled with thread support.

CINT/ROOT C/C++ Interpreter version 5.14.81, Mar 20 2001
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .! printenv A
root [1] gSystem->Setenv("A","B")
root [2] .! printenv A
B
root [3] gSystem->Setenv("A","")
root [4] .! printenv A

root [5] gSystem->Unsetenv("A")

  *** Break *** segmentation violation
Root >


What I expect is (is it what we get form a recent version of root?):

root [0] .! printenv A
root [1] gSystem->Setenv("A","B")
root [2] .! printenv A
B
root [3] gSystem->Setenv("A","")
root [4] .! printenv A

root [5] gSystem->Unsetenv("A")
root [6] .! printenv A
root [7] .q

Thanks




-- 
Nicolas Produit
INTEGRAL Science Data Center    Phone:  +41 22 950 91 40
16, Chemin d'Ecogia             Fax:    +41 22 950 91 33
CH-1290 Versoix                 www:    http://isdc.unige.ch/



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:38 MET