Commit Graph

30 Commits

Author SHA1 Message Date
Brad King c5cc3441b3 Merge branch 'upstream-kwsys' into update-kwsys 2015-09-02 10:23:17 -04:00
Brad King 49d293a795 Merge branch 'upstream-kwsys' into update-kwsys 2015-08-31 09:55:01 -04:00
Brad King 3da431379b Merge branch 'upstream-kwsys' into update-kwsys 2015-08-03 13:17:54 -04:00
Brad King bf365792a1 Merge branch 'upstream-kwsys' into update-kwsys 2015-05-28 08:21:55 -04:00
Brad King 5868b4e2fb Merge branch 'upstream-kwsys' into update-kwsys 2014-10-31 13:11:58 -04:00
Brad King daab3b3bdf Merge branch 'upstream-kwsys' into update-kwsys 2014-09-09 08:46:41 -04:00
Brad King 51c82c3a66 Merge branch 'upstream-kwsys' into update-kwsys 2014-08-11 09:30:22 -04:00
Brad King 60c783676c Merge branch 'upstream-kwsys' into update-kwsys 2014-08-04 10:16:34 -04:00
Brad King 5f525da0e3 Merge branch 'upstream-kwsys' into update-kwsys 2014-07-07 09:04:27 -04:00
Brad King 7fa16df4d7 Merge branch 'upstream-kwsys' into update-kwsys 2014-05-13 14:55:35 -04:00
Brad King 588d705cb1 Merge branch 'upstream-kwsys' into update-kwsys 2013-02-01 09:28:50 -05:00
Brad King e48796b26b KWSys: Fix SystemTools environment memory handling (#13156)
The SystemTools::PutEnv function tries to provide the "putenv" API
without leaking memory.  However, the kwsysDeletingCharVector singleton
frees memory that may still be referenced by the environment table,
having been placed there by putenv.  If any static destruction or
processing by an external tool happens after the singleton is destroyed
and accesses the environment it will read invalid memory.

Replace use of putenv with setenv/unsetenv when available.  The latter
manage internal copies of the values passed instead of referencing the
original memory.  When setenv/unsetenv are not available use putenv with
a singleton that removes its values from the environment before freeing
their memory.  This requires an "unputenv" implementation.  On at least
some platforms it must be written in terms of "putenv" because other
APIs are not available and direct modification of the "environ" global
is not safe (e.g. on Windows there is interaction with "wenviron").
Fortunately either putenv("A=") or putenv("A") will remove "A" from the
environment on these platforms.  On other platforms fall back to direct
manipulation of "environ".

Also add UnPutEnv to the API and add a test for the behavior of both.
2012-04-27 08:13:52 -04:00
Brad King 3a14b6e556 KWSys: Do not mangle UNC paths in ConvertToUnixOutputPath (#10206)
This method replaces '//' with '/' to make the paths look nicer.
Originally it correctly skipped a leading '//' in a UNC path as the
comment says.  However, commit "Removed extra variable initializations"
(2005-04-15) accidentally removed the "pos=1" initializer.  It was then
incorrectly restored by commit "Added missing variable initialization"
(2005-04-15) as just "pos=0".  Restore the proper initializer.

The test for this added by commit "better coverage" (2006-07-31)
included incorrect output for a sample UNC-like path.  Fix it.
2010-12-14 18:13:03 -05:00
Brad King de955e4b6d Convert KWSys to OSI-approved BSD License
This converts the KWSys license to a pure 3-clause OSI-approved BSD
License.  We drop the previous license clause requiring modified
versions to be plainly marked.  We also update the KWSys copyright to
cover the full development time range.
2009-09-28 11:37:35 -04:00
Brad King 3bd9d67488 BUG: Use angle-brackets to include testSystemTools.h to avoid problems with in-source builds. 2007-03-07 13:52:32 -05:00
Brad King 0edbb68352 ENH: Cleaned up KWSys tests to use test drivers. 2007-03-03 10:47:06 -05:00
Brad King 8a79d25927 COMP: Added missing headers. This partially addresses bug#3556. 2006-08-01 14:45:32 -04:00
Ken Martin 4f9fcad327 ENH: better coverage 2006-07-31 13:50:50 -04:00
Ken Martin 9e1f7773e9 BUG: fix some bad code and add a couple more tests 2006-07-28 14:47:37 -04:00
Ken Martin f35c6d461a COMP: fix compile issue 2006-07-25 14:15:01 -04:00
Ken Martin b379666b39 BUG: some bug fixes, better docs, and more coverage 2006-07-25 12:08:05 -04:00
Mathieu Malaterre 1defe94e31 STYLE: Minor style 2006-03-09 14:36:53 -05:00
Sebastien Barre 07b45da693 ENH: CMake kills me (so does Cygwin) 2005-10-06 17:16:07 -04:00
Sebastien Barre 6c54adf0ea ENH: avoid the use of GET_TARGET_PROPERTY by testing the CMake executable instead of the test executable 2005-10-05 16:06:45 -04:00
Sebastien Barre 13627538b9 ENH: add kwsys test for DetectFileType 2005-10-04 15:09:00 -04:00
Sebastien Barre 490119d2aa ENH: fix test, it has to return a true/false value otherwise it just passes the test, and add test for EscapeChars 2005-06-20 13:49:04 -04:00
Brad King caac6c78b4 COMP: Disable MSVC debug symbol truncation warning. 2005-04-13 23:03:26 -04:00
Brad King caf54b2093 COMP: Adding work-around for CMake dependency scanning limitation. Any configured header included by KWSYS_HEADER() in a .c or .cxx file in kwsys itself must use this hack to get dependencies. 2005-04-13 16:46:09 -04:00
Brad King 5e02b5ec96 BUG: Only do ~ test if HOME variable is defined. 2005-04-13 16:05:01 -04:00
Andy Cedilnik 4a390c174c ENH: Do kwsys testing as part of cmake testing, command line arguments are not experimental and add simple test for systemtools 2005-04-13 13:57:24 -04:00