summaryrefslogtreecommitdiffstats
path: root/generic/tclIOUtil.c
Commit message (Collapse)AuthorAgeFilesLines
* Change TCHAR -> WCHAR in many places, since that's what it is since Windows NTjan.nijtmans2019-03-111-1/+1
|
* protect Tcl_WinUtfToTChar/Tcl_WinTCharToUtf against NULL input values: ↵jan.nijtmans2018-10-061-4/+4
| | | | | return empty string in that case. Add TIP #494-compatible definitions of TCL_IO_FAILURE/TCL_AUTO_LENGTH, and use it in some appropriate places.
* Eliminate the use of macro's like LLONG_MAX|MIN, since they assume that ↵jan.nijtmans2018-09-131-2/+2
| | | | Tcl_WideInt equals "long long". Also eliminate uses of Tcl_WideAsLong() and friends, as - often - simple type cases make things more clear.
* Merging changes with 8.7hypnotoad2018-08-141-25/+4
|\
| * merge 8.6jan.nijtmans2018-07-311-25/+4
| |\
| | * Remove some actually dead codejan.nijtmans2018-07-311-25/+4
| | |
* | | merge 8.7dgp2018-05-241-2/+2
|\ \ \ | |/ /
| * | General code style cleanup.dkf2018-05-131-2/+2
| | |
* | | merge 8.7dgp2018-03-071-9/+0
|\ \ \ | |/ /
| * | Re-implement Tcl_WinTCharToUtf/Tcl_WinUtfToTChar in pure win32 api, even for ↵jan.nijtmans2018-01-101-9/+0
| | | | | | | | | | | | TCL_UTF_MAX=3. We can do that now safely, because of the changed handling of valid 4-byte UTF-8 characters in the previous commit.
* | | Pulling changes from core-8-branchhypnotoad2017-12-131-1/+1
|\ \ \ | |/ /
| * | Eliminate use of certain unnecessary struct names. Also white-spacing. ↵jan.nijtmans2017-11-301-1/+1
| | | | | | | | | | | | Nothing functional.
* | | Reserve paths matching //[^/]*: for VFS mount points, and prevent callingaspect2017-11-181-14/+45
|/ / | | | | | | | | native filesystem ops during normalization for them. This is permitted by UNC standards (which do not allow : at the end), and should prevent observed slow [glob] operations (and others) on Windows when using such paths.
* | Merge core-8-6-branchjan.nijtmans2017-11-131-1/+0
|\ \ | |/
| * No longer mark Tcl_EvalFile() as obsolete, since it will continue to be ↵jan.nijtmans2017-11-131-1/+0
| |\ | | | | | | | | | supported in Tcl 9.0
| | * No longer mark Tcl_EvalFile() as obsolete, since it will continue to be ↵jan.nijtmans2017-11-131-1/+0
| | | | | | | | | | | | supported in Tcl 9.0
| | * Cherrypick [527d354828]andy2017-08-081-1/+1
| | |
| * | Cherrypick [527d354828]andy2017-08-081-2/+2
| | |
* | | [5bfe3de008]: Modify [source] to set input EOF character but not output EOF ↵andy2017-08-071-2/+2
| | | | | | | | | | | | character. This avoids having ^Z being appended to the sourced file when it is an always-writable [tcl::chan::variable] in a custom VFS. Tested by adding this same change as a patch to Tcl 8.6.6 in KitCreator because that seems to be the easiest way to get custom VFS capability exposed as script commands. Original problem introduced by [03cdfc3a86] 2000-05-11 00:16:52.
* | | Remove some unnecessary "struct" definitions and some type casts no longer ↵jan.nijtmans2017-04-111-1/+1
| | | | | | | | | | | | necessary. No functional changes.
* | | More minor style fixes.dkf2017-04-101-22/+29
| | |
* | | Merge trunk.jan.nijtmans2016-11-251-0/+1
| | | | | | | | | Implementation looks complete. Still missing: test-cases and documentation.
* | | Fix [79614fb8b61983ac8ef30ea8752c310465798fc7|79614fb8b6]: "glob", "encoding ↵jan.nijtmans2016-11-111-2/+2
|\ \ \ | |/ / | | | | | | system" and encoding-free filesystems
| * | Fix [79614fb8b61983ac8ef30ea8752c310465798fc7|79614fb8b6]: "glob", "encoding ↵jan.nijtmans2016-11-111-2/+2
| |\ \ | | |/ | | | | | | system" and encoding-free filesystems
| | * Fix [79614fb8b61983ac8ef30ea8752c310465798fc7|79614fb8b6]: "glob", "encoding ↵jan.nijtmans2016-11-111-2/+2
| | | | | | | | | | | | system" and encoding-free filesystems
* | | Micro-optimization: Use TclGetStringFromObj in stead of Tcl_GetStringFromObj ↵jan.nijtmans2016-07-081-14/+14
|/ / | | | | | | in many places where possible.
* | Simplify all the Tcl_NRPostProc declarations.dgp2016-07-061-2/+1
| |
* | Where "interp" is only used for error-reporting, it can be allowed to be ↵jan.nijtmans2015-10-071-10/+24
| | | | | | | | NULL. This should fix [5da26d4760]: Tcl_LoadFile() segfaults if "interp" is NULL.
* | Increase some counter sizes related to filesystem epoch from int to size_t. ↵jan.nijtmans2015-07-151-13/+25
| | | | | | | | And prevent them ever becoming 0 due to an overflow. (backported with variation from androwish)
* | If the file system changes when "cwd" changes, force a filesystem refresh on ↵jan.nijtmans2015-06-231-6/+17
| | | | | | | | path objects. Needed for AndroWish/TclKit (???) in obscure situations, harmless on systems which only have a single native filesystem.
* | Merged the workarounds and fixes for wrapped executables on variousandreask2014-05-281-1/+85
|\ \ | |/ | | | | | | platforms into the trunk. For details see the merged revision and its ancestor.
| * Followup on [72c54e1659]. Removed unused variable.andreask2014-05-231-1/+0
| |
| * Workarounds and fixes for wrapped executables on various platforms andreask2014-05-221-1/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | regarding the handling of wrapped dynamic libraries. The basic flow of operation is to copy such libraries into a temp file, hand them to the OS loader for processing, and then to delete them immediately, to prevent them from being accessible to other executables. On platforms where that is not possible the library is left in place and things are arranged to delete it on regular process exit. An example of the latter are older revisions of HPUX which report that the file is busy when trying to delete it. Younger revisions of HPUX have changed to allow the deletion, but are also buggy, the OS loader mangles its data structures so that a second library loaded in this manner fails. More recently it was found that Linux which is usually ok with deleting the file and gets everything right shows the same trouble as modern HPUX when the "docker" containerization system is involved, or more specifically the AUFS in use there. Deleting the loaded library file mangles data structures and breaks loading of the following libraries. For a demonstration which does not involve Tcl at all see the ticket https://github.com/dotcloud/docker/issues/1911 in the docker tracker. This of course breaks the use of wrapped executables within docker containers. This commit introduces the function TclSkipUnlink() which centralizes the handling of such exceptions to unlinking the library after unload, and provides code handling the known cases. IOW HPUX is generally forced to not unlink, and ditto when we detect that the copied library file resides within an AUFS. The latter must however be explicitly activated by setting the define -DTCL_TEMPLOAD_NO_UNLINK during build. We still need proper configure tests to set it on the relevant platforms (i.e. Linux). The AUFS detection and handling can be overridden by the environment variable TCL_TEMPLOAD_NO_UNLINK which can force the behaviour either way (skip or not). In case the user knows best, or wishes to test if the problem with AUFS has been fixed.
* | Eliminate all usage of WIN32 and __WIN32__ macros: Some compilers (e.g. ↵jan.nijtmans2014-02-101-4/+4
| | | | | | | | | | Clang/LLVM) don't define it, and _WIN32 is much more portable anyway. See: [http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system#WindowsCygwinnonPOSIXandMinGW]
* | revert mistaken commit of experimentdgp2013-09-231-1/+1
| |
* | merge releasedgp2013-09-201-1/+1
| |
* | 3613569 Handle case when TclpTempFileNameForLibrary returns NULL.dgp2013-05-201-0/+3
| |
* | Unbreak msvc builds, by depending on tclPort.h for inclusion of <sys/stat.h>jan.nijtmans2013-02-101-1/+0
|\ \ | |/
| * Unbreak msvc builds, by depending on tclPort.h for inclusion of <sys/stat.h>.jan.nijtmans2013-02-101-1/+0
| |
* | revert [8abba84224], and make sure that every source file that uses ↵jan.nijtmans2013-01-171-3/+1
|\ \ | |/ | | | | Tcl_StatBuf has an "#include <sys/stat.h>" before including tcl.h
| * revert [8abba84224], and make sure that every source file that uses ↵jan.nijtmans2013-01-171-3/+1
| | | | | | | | Tcl_StatBuf has an "#include <sys/stat.h>" before including tcl.h
| * Add dummy 0 parameter (unused flags) to internal Tcl_FSLoadFileProc call, ↵jan.nijtmans2012-10-241-1/+5
| |\ | | | | | | | | | for upwards compatibility with version 2 filesystems
| | * Add dummy 0 parameter (unused flags) to internal Tcl_FSLoadFileProc call, ↵jan.nijtmans2012-10-241-1/+5
| | | | | | | | | | | | for upwards compatibility with version 2 filesystems
| | * Reference to correct Bug #numberjan.nijtmans2012-08-061-1/+1
| | |
* | | unbreak Mac OSX buildjan.nijtmans2012-10-231-1/+1
| | |
* | | Add "flags" parameter from Tcl_LoadFile to to various internal functions, so ↵jan.nijtmans2012-10-231-52/+8
|\ \ \ | |/ / | | | | | | these flags are available through the whole filesystem for (future) internal use
| * | Remove unused TclpLoadFile function.jan.nijtmans2012-10-231-43/+0
| | |
* | | Minor changes to improve style (C89 declarations, consistent indentation,dkf2012-08-071-3/+6
| | | | | | | | | | | | clarification of #endifs, reduction of unnecessary casts, use of array syntax for reading array elements, etc.)
| | |
| \ \
*-. \ \ 3554250 Overlooked one field of cleanup in the thread exit handlerdgp2012-08-071-0/+1
|\ \ \ \ | | |/ / | | | | for the filesystem subsystem.
| | * | 3554250 Overlooked one field of cleanup in the thread exit handlerdgp2012-08-071-0/+1
| |/ / | | | | | | for the filesystem subsystem.