summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/SystemTools.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2014-05-191-2/+5
|
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2014-05-131-107/+107
|
* Remove some c_str() calls.Stephen Kelly2014-03-111-2/+2
| | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2014-03-041-0/+3
|
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2013-12-191-2/+2
|
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2013-11-251-95/+194
|
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2013-10-081-5/+0
|
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2013-08-071-106/+103
|
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2013-07-111-8/+4
|
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2013-06-261-1/+1
|
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2013-06-041-1/+1
|
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2013-06-031-10/+46
|
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2013-05-291-4/+13
|
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2013-05-071-1/+1
|
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2013-04-261-2/+2
|
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2013-02-071-18/+10
|
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2013-02-011-2/+2
|
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2013-01-081-15/+4
|
* Merge branch 'upstream-kwsys' into update-kwsysBrad King2012-12-191-1/+7
|
* Merge branch 'upstream-kwsys' into import-KWSys-subtreeBrad King2012-10-011-1/+1
|
* KWSys: Remove unused environ declaration from SystemToolsBrad King2012-05-231-4/+0
| | | | | | | | | | Commit "KWSys: Fix SystemTools environment memory handling" (2012-04-26) added a _WIN32 case inside !KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H to dllimport the "environ" global. Howver, KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H is true on every Windows toolchain we support so the case is never reached. Furthermore, even if it were reached the use of dllimport is incorrect because the toolchain might not be compiling with a dynamic runtime library. Remove the unused incorrect line and supporting conditionals.
* KWSys: Fix SystemTools environment memory handling (#13156)Brad King2012-04-271-20/+216
| | | | | | | | | | | | | | | | | | | | | | | 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.
* KWSys: Correctly handle empty environment variablesBrad King2011-12-151-1/+1
| | | | | | | Fix a crash which occurs when SystemTools::GetPath attempts to process an empty environment variable. Author: Vladimir Panteleev <vladimir@thecybershadow.net>
* KWSys: Fix wrong spelling of __INTEL_COMPILERBrad King2011-11-131-6/+1
| | | | | Author: Hans Johnson <hans-johnson@uiowa.edu> Change-Id: I31a29a8b53e5262b76530b8ea80a1a66cff7b3f7
* KWSys: Remove trailing whitespace in SystemTools.cxxBrad King2011-11-131-128/+128
|
* KWSys: Address Intel compiler remarksBrad King2011-11-011-0/+8
| | | | | | | | | | | | | | | | | CommandLineArguments.cxx: remark #181: argument is incompatible with corresponding format string conversion SystemInformation.cxx: remark #193: zero used for undefined preprocessing identifier "_WIN32" warning #177: variable "Regebx" was declared but never referenced SystemTools.cxx(375): remark #444: destructor for base class "std::vector<char*>" is not virtual class kwsysDeletingCharVector : private kwsys_stl::vector<char*> Author: Hans Johnson <hans-johnson@uiowa.edu> Change-Id: Ibc899c3ba14990158ef7bbabace4b435b22495c3
* KWSys: Remove translation path for "/tmp_mnt/" (#10595)David Cole2011-08-201-2/+0
| | | | | | | In SystemTools::ClassInitialize, remove call to AddTranslationPath that was originally put in place to "work around an SGI problem." This code precluded using CMake effectively in valid directories under "/tmp_mnt/"
* KWSys: Avoid conversion warning in SystemTools::GetTimeBrad King2011-08-041-1/+1
| | | | | Convert struct timeval members to double explicitly to avoid a GCC warning with -Wconversion.
* KWSys: Simplify SystemTools::GetTime implementation (#12261)Brad King2011-08-031-57/+16
| | | | | | We already use GetSystemTimeAsFileTime() and gettimeofday() unconditionally on supported Windows and non-Windows platforms, respectively. Remove outdated portability complexity.
* KWSys: Fix WOW64 registry mode on Windows 2000 (#10759)David Cole2011-01-101-2/+2
| | | | | | The previous commit did not compile with mingw gcc. Use the Windows type FARPROC instead of void* for the local variable.
* Fix WOW64 registry mode on Windows 2000 (#10759)David Cole2011-01-071-0/+8
| | | | | | | | | | | | | | | CMake fails to find any registry paths on Windows 2000: according to regmon it fails with an access denied error. I double checked all the access rights and they are fine. After checking the access modes on MSDN I found that it says KEY_WOW64_32KEY / KEY_WOW64_64KEY are not supported on Windows 2000. CMake does not check if the current system supports Wow64 before applying these flags. This commit adds a check for IsWow64Process in kernel32.dll before adding these flags. Author: Axel Gembe <ago@bastart.eu.org> Signed-off-by: Axel Gembe <ago@bastart.eu.org>
* KWSys: Avoid passing string literal as char*Brad King2010-12-281-1/+2
| | | | | | Pass the lpClass argument of RegCreateKeyEx as a real char[] instead of a string literal. At least one platform declares the argument as char* instead of "const char*".
* KWSys: Do not mangle UNC paths in ConvertToUnixOutputPath (#10206)Brad King2010-12-141-1/+1
| | | | | | | | | | | | 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.
* KWSys: Remove realpath from SystemTools::GetPath (#10335)Brad King2010-12-081-3/+1
| | | | | | | | | | Commit "merge in changes for beos support" (2006-12-04) added a realpath call for every directory parsed out of a PATH-style environment variable. No reason was given in the commit message or comments. The call incorrectly resolves symlinks in referenced paths. Remove it. If BeOS support really needs it then it can be restored for that platform with a full explanation.
* KWSys: Use SplitPath in GetActualCaseForPathBrad King2010-08-271-7/+12
| | | | | Avoid using the old SplitString method in favor of the more robust SplitPath method.
* KWSys: Avoid empty string dereference in SplitStringBrad King2010-08-271-0/+4
|
* KWSys: Fix GetActualCaseForPath for UNC pathsBrad King2010-08-161-39/+46
| | | | | | See issue #11023. Author: Clinton Stimpson <clinton@elemtech.com>
* KWSys: Fix SplitPath for leading '\' on WindowsBrad King2010-08-161-2/+2
| | | | | Windows paths may begin with a single backslash when the drive letter is omitted. Recognize this as a root path component.
* KWSys: Remove "copyPermissions" parametersBrad King2010-06-041-16/+11
| | | | | | | | The CopyFileIfDifferent, CopyFileAlways, CopyAFile and CopyADirectory methods should always copy permissions. The special cases in which a caller would pass copyPermissions=false should be handled at the call site. The parameter needlessly complicates the interface and semantics of these methods.
* KWSys: Avoid stat in CopyFileAlways (#10790)Brad King2010-06-031-13/+1
| | | | | | | On Windows 7 the file size reported by 'stat' on a new file sometimes reports zero even though the real size is correct. This causes our CopyFileAlways method to falsely detect copy failure. Work around the problem by trusting the state of ofstream after writing the file.
* Fix for bug #10542, allow this to build on Tru64Bill Hoffman2010-05-041-0/+7
|
* Patch to avoid short name usage where possible. Get the actual case spelling ↵David Cole2010-04-091-61/+20
| | | | of a file name on 'Windows' without converting to short name and back again. Avoids bad behavior reported in http://bugs.winehq.org/show_bug.cgi?id=22286 when using cmake under a wine/msys/mingw installation on a Linux box. Thanks to Clinton Stimpson for preparing the patch.
* Mac has gettimeofday defined, but cmsys wasn't aware of that, so it was ↵Zach Mullen2009-11-241-1/+1
| | | | falling back to using time() which only provides second resolution. Fixed to allow usec res.
* Better fix for crash on Windows. This time it will even work on Linux, too. ↵David Cole2009-10-161-2/+14
| | | | That GetLineFromStream method while loop sure is fussy.
* Fix crash on Windows. If input stream is no good, do not try to read a line ↵David Cole2009-10-161-2/+3
| | | | from it. Return false and an empty line instead...
* Convert KWSys to OSI-approved BSD LicenseBrad King2009-09-281-11/+9
| | | | | | | 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.
* Restore KWSys SystemTools _WIN32 state on cygwinBrad King2009-09-241-2/+5
| | | | | | | | | | | The commit "Fix KWSys SystemTools build on cygwin with -mwin32" tried to restore the state of the _WIN32 definition that was broken by the commit "Optimize KWSys SystemTools::FileExists on Windows". It did so for the case of building with -mwin32 on cygwin, but since including <windows.h> defines _WIN32, it failed for the case of not using -mwin32. This commit restores the state of _WIN32 in all cases by undefining it after including <windows.h> if it was not defined beforehand.
* Fix KWSys SystemTools build on cygwin with -mwin32Brad King2009-09-231-2/+1
| | | | | | | Commit "Optimize KWSys SystemTools::FileExists on Windows" accidentally added "#undef _WIN32" when including <windows.h> on cygwin, which breaks builds using the -mwin32 flag. This commit removes that line and fixes the real error it was intended to avoid.
* Put a flag in that will stop system tools from deleting system environment ↵Bill Hoffman2009-09-221-0/+2
| | | | memory on exit, as it can cause gcov to crash the programs.
* Optimize KWSys SystemTools::FileExists on WindowsBrad King2009-09-221-21/+65
| | | | | | | | | | We optimize this method by using the GetFileAttributesExA native Windows API to check for file existence when possible. For real Windows builds we always use it. For Cygwin we use cygwin_conv_to_win32_path to get a native Windows path if possible and otherwise fall back to 'access'. Cygwin-to-Windows path conversion and cache by Wojciech Migda. See issue #8826.