From: Ryan B. <rm...@us...> - 2010-05-12 22:38:03
|
Update of /cvsroot/nant/nant/src/NAnt.Core/Tasks In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv16609/src/NAnt.Core/Tasks Modified Files: SetEnvTask.cs Log Message: Fixes a test failure that was assigning empty strings to env vars instead of removing the var. This test failure was introduced when .NET 4.0 support was committed. Also update another Gert email address. Index: SetEnvTask.cs =================================================================== RCS file: /cvsroot/nant/nant/src/NAnt.Core/Tasks/SetEnvTask.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SetEnvTask.cs 17 Apr 2008 16:35:15 -0000 1.9 --- SetEnvTask.cs 12 May 2010 22:37:52 -0000 1.10 *************** *** 17,21 **** // // Ian MacLean (ima...@gm...) ! // Gert Driesen (ger...@ce...) using System; --- 17,21 ---- // // Ian MacLean (ima...@gm...) ! // Gert Driesen (dr...@us...) using System; *************** *** 265,270 **** // expand any env vars in value string expandedValue = null; ! if (value != null) { expandedValue = Environment.ExpandEnvironmentVariables(value); } --- 265,275 ---- // expand any env vars in value + // If value is null or empty (""), keep the expanded variable null. + // This will prevent the SetEnvironmentVariable method (both from + // kernel.dll (.NET 1.0) and System.Environment (.NET 2.0+)) from + // assigning a env var an empty value. Seems to be an issue that + // was introduced with .NET 4.0 string expandedValue = null; ! if (!StringUtils.IsNullOrEmpty(value)) { expandedValue = Environment.ExpandEnvironmentVariables(value); } |