summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/SystemTools.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* COMP: attempt to fix more 'hidden by' warnings.Dave Partyka2009-08-061-1/+1
|
* ENH: try and see if using string.append instead of += will make valgrind not ↵Dave Partyka2009-07-261-4/+4
| | | | complaing that JoinPath is leaking.
* COMP: Remove useless variable assignmentBrad King2009-06-221-1/+0
| | | | | This removes an assignment whose result is never used, thus quieting a warning from Borland.
* ENH: use .exe on vmsBill Hoffman2009-06-111-1/+1
|
* ENH: Teach KWSys SystemTools about VMS pathsBrad King2009-06-101-2/+45
| | | | | | This teaches ConvertToUnixSlashes to convert VMS paths into posix-style paths. We also set the DECC$FILENAME_UNIX_ONLY feature so the process always sees posix-style paths on disk.
* ENH: fix warning on borlandBill Hoffman2009-06-051-9/+9
|
* ENH: move PutEnv to SystemToolsBill Hoffman2009-06-051-0/+27
|
* BUG: Fix removal of read-only directoriesBrad King2009-05-131-0/+13
| | | | | Read-only directories must be given write permission before we can remove files and subdirectories from them.
* ENH: check in almost building VMS stuff with VMSBuild directory since the ↵Bill Hoffman2009-04-231-1/+3
| | | | bootstrap script will not work on VMS
* ENH: Remove obscure method from KWSys SystemToolsBrad King2009-04-211-23/+0
| | | | | This removes SystemTools::FileExistsInParentDirectories from KWSys since it is a special-purpose method that is not generally useful.
* BUG: Fix SystemTools::IsSubDirectory on bad inputBrad King2009-04-201-0/+4
| | | | | | | | When SystemTools::GetParentDirectory was fixed to never remove the root path component from a full path we violated an assumption made by IsSubDirectory that eventually GetParentDirectory returns an empty string. This led to an infinite loop if the potential parent directory is empty, so we explicitly avoid that case.
* BUG: Replace brittle GetParentDirectory implBrad King2009-04-151-25/+1
| | | | | | | The previous change to this method broke cases where the input path does not exist. The SystemTools::GetParentDirectory method is redundant with the more robust SystemTools::GetFilenamePath. This replaces its implementation to just call GetFilenamePath.
* BUG: SystemTools::GetParentDirectory() will crash if "/" is passed in as ↵Yumin Yuan2009-04-151-1/+7
| | | | argement. Valid check is added to make sure the input argment exists, and if "/" is passed in, empty string will be returned.
* COMP:Fixed warnings.Francois Bertel2009-03-181-11/+16
|
* BUG: Work around broken GetLongPathName caseBrad King2009-02-091-0/+5
| | | | | | | On Windows the GetLongPathName API function does not work on some filesystems even if the file exists. In this case we should just use the original long path name and not the GetShortPathName result. See issue #8480.
* BUG: Fix GetRealPath when realpath failsBrad King2009-02-091-2/+14
| | | | | | This patch from Philip Lowman teaches SystemTools::GetRealPath to deal with paths that do not exist by dealing with the case that realpath returns NULL. See issue #8423.
* BUG: Do not copy permissions of files when making the copy in an install ↵David Cole2008-12-181-11/+17
| | | | rule. If the source file was read-only, this prevents the subsequent set of the destination file's modification time, making the copied file always different in time-stamp than the original and always installing a new file with a new time stamp (but the same content) causing unnecessary downstream incremental rebuilds. As part of this fix, add an optional copyPermissions parameter to the SystemTools routines CopyFileIfDifferent, CopyFileAlways, CopyAFile and CopyADirectory. The copyPermissions parameter defaults to true to preserve the behavior of these routines for existing callers.
* ENH: fix for VistaSebastien Barre2008-10-161-1/+1
|
* ENH: oopsSebastien Barre2008-10-161-0/+4
|
* ENH: fix for Windows VistaSebastien Barre2008-10-161-7/+22
|
* STYLE: Fix typo in GetFilenameLastExtension docsBrad King2008-10-101-1/+1
| | | | See issue #7797.
* ENH: add initial support for HAIKU OS from bug# 7425Bill Hoffman2008-09-151-1/+6
|