summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
Commit message (Collapse)AuthorAgeFilesLines
...
| * Experimental change. Easier to check in and later back out if thereandreas_kupries2003-04-101-1/+13
| | | | | | | | | | | | are problems than to try and compile everything manually on all the platforms. This way the AS auto-build gets the change without fuss, and I can read the logs tomorrow.
* | [backport] Make sure [fcopy -size ... -command ...] always calls the ↵ferrieux2010-12-101-1/+38
| | | | | | | | callback asynchronously, even for size zero.
* | * generic/tclIO.c (CopyData): Allow the total number of bytes copieddkf2010-03-201-4/+5
| | | | | | | | by [fcopy] to exceed 2GB. Can happen when no -size parameter given.
* | * generic/tclIO.c (CreateScriptRecord): [Bug 2918110]: Initializeandreas_kupries2010-01-181-6/+23
| | | | | | | | | | | | | | | | the EventScriptRecord (esPtr) fully before handing it to Tcl_CreateChannelHandler for registration. Otherwise a reflected channel calling 'chan postevent' (== Tcl_NotifyChannel) in its 'watchProc' will cause the function 'TclChannelEventScriptInvoker' to be run on an uninitialized structure.
* | * generic/tclIO.c (CopyData): [Bug 2895565]. Dropped bogosityandreas_kupries2009-11-121-10/+13
| | | | | | | | | | | | which used the number of _written_ bytes or character to update the counters for the read bytes/characters. See last entry for the test case.
* | Backported fix for [Bug 2888099] (close discards ENOSPC error) byferrieux2009-11-111-2/+15
| | | | | | | | | | saving the errno from the first of two FlushChannel()s. Uneasy to test; might need specific channel drivers. Four-hands with aku.
* | * generic/tclIO.c (FlushChannel): Skip OutputProc for low-levelandreas_kupries2009-10-231-2/+6
| | | | | | | | | | | | 0-length writes. When closing pipes which have already been closed not skipping leads to spurious SIG_PIPE signals. Reported by Mikhail Teterin <mi+thun@aldan.algebra.com>.
* | * generic/tclIO.c: Revised ReadChars and FilterInputBytes routinesdgp2009-10-191-17/+27
| | | | | | | | | | | | | | to permit reads to continue up to the string limits of Tcl values. Before revisions, large read attempts could panic when as little as half the limiting value length was reached. [Patch 2107634] Thanks to Sean Morrison and Bob Parker for their roles in the fix.
* | * generic/tclIO.c (Tcl_GetChannelHandle): [Bug 2826248]: Do not crashandreas_kupries2009-07-241-1/+9
| | | | | | | | | | | | | | | | * generic/tclPipe.c (FileForRedirect): for getHandleProc == NULL, this is allowed. Provide a nice error message in the bypass area. Updated caller to check the bypass for a mesage. Bug reported by Andy Sonnenburg <andy22286@users.sourceforge.net>. Backported from CVS head.
* | * generic/tclIO.c (SetChannelFromAny and related): Modified theandreas_kupries2008-12-111-3/+17
| | | | | | | | | | | | | | | | * tests/io.test: internal representation of the tclChannelType to contain not only the ChannelState pointer, but also a reference to the interpreter it was made in. Invalidate and recompute the internal representation when it is used in a different interpreter (Like cmdName intrep's). Added testcase. [Bug 2407783].
* | * generic/tclIO.c (TclFinalizeIOSubsystem): Replaced Alexandreandreas_kupries2008-12-021-3/+3
| | | | | | | | | | Ferrieux's first patch for [Bug 2270477] with a gentler version, also supplied by him.
* | * generic/tclIO.c (TclFinalizeIOSubsystem): Applied Alexandreandreas_kupries2008-11-251-2/+2
| | | | | | | | | | Ferrieux's patch for [Bug 2270477] to prevent infinite looping during finalization of channels not bound to interpreters.
* | * generic/tclIO.c: Backport of fix for [Bug 2333466].andreas_kupries2008-11-231-2/+5
| |
* | * win/tclWinChan.c (FileWideSeekProc): Accepted a patch byandreas_kupries2008-05-231-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | Alexandre Ferrieux <ferrieux@users.sourceforge.net> to fix the [Bug 1965787]. 'tell' now works for locations > 2 GB as well instead of going negative. * generic/tclIO.c (Tcl_SetChannelBufferSize): Accepted a patch by * tests/io.test: Alexandre Ferrieux <ferrieux@users.sourceforge.net> * tests/chanio.test: to fix the [Bug 1969953]. Buffersize outside of the supported range are now clipped to nearest boundary instead of ignored.
* | * generic/tclIO.c (CopyData): Applied another patch by Alexandreandreas_kupries2008-04-151-6/+8
| | | | | | | | | | | | | | * io.test (io-53.8a): Ferrieux <ferrieux@users.sourceforge.net>, * chanio.test (chan-io-53.8a): to shift EOF handling to the async part of the command if a callback is specified, should the channel be at EOF already when fcopy is called. Testcase by myself.
* | * tests/io.test (io-53.10): Testcase for bi-directionaly fcopy.andreas_kupries2008-04-071-27/+39
| | | | | | | | | | | | | | | | * tests/chanio.test: * generic/tclIO.c: Additional changes to data structures for fcopy * generic/tclIO.h: and channels to perform proper cleanup in case of a channel having two background copy operations running as is now possible.
* | * generic/tclIO.c (BUSY_STATE, CheckChannelErrors,andreas_kupries2008-04-071-4/+8
| | | | | | | | | | | | TclCopyChannel): New macro, and the places using it. This change allows for bi-directional fcopy on channels. Thanks to Alexandre Ferrieux <ferrieux@users.sourceforge.net> for the patch.
* | * generic/tclIO.c (CopyData): Applied patch [Bug 1932639] toandreas_kupries2008-04-031-14/+24
| | | | | | | | | | | | * tests/io.test: prevent fcopy from calling -command synchronously * tests/chanio.test: the first time. Thanks to Alexandre Ferrieux <ferrieux@users.sourceforge.net> for report and patch.
* | * generic/tclIO.c (CopyData): Applied patch for the fcopy problemandreas_kupries2008-04-021-2/+2
| | | | | | | | | | | | | | [Bug 780533], with many thanks to Alexandre Ferrieux <ferrieux@users.sourceforge.net> for tracking it down and providing a solution. Still have to convert his test script into a proper test case.
* | * generic/tclIO.c (TclGetsObjBinary): operate on topmost channel.hobbs2008-01-201-7/+13
| | | | | | | | [Bug 1869405] (Ficicchia)
* | merge stable branch onto HEADdgp2007-12-131-1/+1
| |
* | make tclChannelType static (fix 'make checkstubs')das2007-12-101-2/+2
| |
* | * tests/io.test, tests/chanio.test (io-73.1): Make sure to invalidatehobbs2007-12-091-6/+8
| | | | | | | | | | * generic/tclIO.c (SetChannelFromAny): internal rep only after validating channel rep. [Bug 1847044]
* | * generic/tclIO.h: Create Tcl_Obj for Tcl channels to reducehobbs2007-12-051-41/+283
| | | | | | | | | | | | | | * generic/tclIO.c: overhead in lookup by Tcl_GetChannel. New * generic/tclIOCmd.c: TclGetChannelFromObj for internal use. * generic/tclIO.c (WriteBytes, WriteChars): add opt check to avoid EOL translation when not linebuffered or using lf. [Bug 1845092]
* | * generic/tclIO.c: Simplify test and improve accuracy of errordgp2007-11-281-5/+4
| | | | | | | | message in latest changes.
* | -eofchar must support no eofchar.patthoyts2007-11-281-3/+3
| |
* | * doc/chan.n: "Fix" the limitation on channel -eofchardgp2007-11-271-13/+18
| | | | | | | | | | | | | | * doc/fconfigure.n: values to single byte characters by documenting * generic/tclIO.c: it and making it fail loudly. Thanks to * tests/chan.test: Stuart Cassoff for contributing the fix. [Bug 800753]
* | Simplifications (fewer casts, less manual bit twiddling)dkf2007-11-191-192/+191
| |
* | [Patch 1830038]: Increased usage of macros to detect and take advantage of ↵Miguel Sofer2007-11-111-9/+9
| | | | | | | | objTypes.
* | fix (unsigned char*) vs. (char*) warningsdas2007-11-081-2/+2
| |
* | (DoWriteChars): special case for 1-byte channel write.hobbs2007-11-071-6/+11
| |
* | * generic/tclIO.c (TclGetsObjBinary): add an efficient binary pathhobbs2007-11-071-4/+254
| | | | | | | | for [gets].
* | (CopyData): avoid leaking msg and errObj (if interp == NULL)das2007-09-171-15/+27
| |
* | * generic/tclInt.decls: New internal routine TclBackgroundException()dgp2007-09-061-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclEvent.c: that for the first time permits non-TCL_ERROR exceptions to trigger [interp bgerror] handling. Closes a gap in TIP 221. When falling back to [bgerror] (which is designed only to handle TCL_ERROR), convert exceptions into errors complaining about the exception. * generic/tclInterp.c: Convert Tcl_BackgroundError() callers to call * generic/tclIO.c: TclBackgroundException(). * generic/tclIOCmd.c: * generic/tclTimer.c: * generic/tclIntDecls.h: make genstubs * generic/tclStubInit.c:
* | * generic/tclIO.c: Removed dead code.dgp2007-07-021-9/+1
| | | | | | | | * unix/tclUnixChan.c:
* | * tests/encoding.test: Modified so that encoding tests happenKevin B Kenny2007-05-041-2/+2
| | | | | | | | | | | | | | | | | | in a private namespace, to avoid polluting the global one. This problem was discovered when running the test suite '-singleproc 1 -skip exec.test' because the 'path' variable in encoding.test conflicted with the one in io.test. * tests/io.test: Made more of the working variables private to the namespace.
* | * generic/tclIO.c (DeleteChannelTable): Made changes so thatKevin B Kenny2007-05-011-60/+72
| | | | | | | | | | | | | | DeleteChannelTable tries to close all open channels, not just the first. [Bug 1710285] * generic/tclThread.c (TclFinalizeSynchronization): Make sure that TSD blocks get freed on non-threaded builds. [Bug 1710825]
* | * generic/tclIO.c (FixLevelCode): Corrected reference countandreas_kupries2007-04-301-13/+19
| | | | | | | | | | | | mismanagement of newlevel, newcode. Changed to allocate the Tcl_Obj's as late as possible, and only when actually needed. [Bug 1705778, leak K29].
* | Whitespace policing, replacing commas in varargs with constant string ↵Kevin B Kenny2007-04-201-11/+11
| | | | | | | | catenation, and fixed an oversight in the fix for NZA time zones.
* | Simplification of some argument processing through introduction of a helperdkf2007-04-051-26/+26
| | | | | | | | macro.
* | various "const" additions, in line with TIP #27nijtmans2007-02-231-69/+69
| |
* | Missed a spot; thanks to Andreas Kupries for spotting this one.dkf2007-01-171-5/+10
| |
* | Added macros to make usage of ChannelBuffers clearer.dkf2007-01-171-81/+128
| |
* | * generic/tclIO.c (Tcl_GetsObj):mdejong2006-12-271-14/+20
| | | | | | | | | | Avoid checking for for the LF in a possible CRLF sequence when EOF has already been found.
* | * generic/tclIO.c: When [gets] on a binary channel needs to usedgp2006-11-131-12/+41
| | | | | | | | | | | | | | the "iso8859-1" encoding, save a copy of that encoding per-thread to avoid repeated freeing and re-loading of it from the file system. This replaces the cached copy of this encoding that the platform initialization code used to keep in pre-8.5 releases.
* | * generic/tclCompExpr.c: fix gcc warnings about 'cast to/fromdas2006-11-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclEncoding.c: pointer from/to integer of different * generic/tclEvent.c: size' on 64-bit platforms by casting to * generic/tclExecute.c: intermediate types intptr_t/uintptr_t * generic/tclHash.c: via new PTR2INT(), INT2PTR(), * generic/tclIO.c: PTR2UINT() and UINT2PTR() macros. * generic/tclInt.h: [Patch 1592791] * generic/tclProc.c: * generic/tclTest.c: * generic/tclThreadStorage.c: * generic/tclTimer.c: * generic/tclUtil.c: * unix/configure.in: * unix/tclUnixChan.c: * unix/tclUnixPipe.c: * unix/tclUnixPort.h: * unix/tclUnixTest.c: * unix/tclUnixThrd.c: * unix/configure: autoconf-2.59 * unix/tclConfig.h.in: autoheader-2.59
* | Rewrite for style and clarity (esp. tclPkg.c)dkf2006-11-081-231/+275
| |
* | * generic/tclIO.c (Tcl_GetsObj): added two test'n'panic guards forMiguel Sofer2006-09-281-1/+7
| | | | | | | | possible NULL derefs, [Bug 1566382] and coverity #33.
* | * generic/tclIO.c (Tcl_StackChannel): Fixed [SF Tcl Bug 1564642],andreas_kupries2006-09-251-2/+2
| | | | | | | | | | aka coverity #51. Extended loop condition, added checking for NULL to prevent seg.fault.
* | * generic/tclIO.c (ReadChars): Added check and panic andandreas_kupries2006-04-051-1/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commentary to a piece of code which relies on BUFFER_PADDING to create enough space at the beginning of each buffer forthe insertion of partial multi-byte data at the beginning of a buffer. To explain why this code is ok, and as precaution if someone twiddled the BUFFER_PADDING into uselessness. * generic/tclIO.c (ReadChars): [SF Tcl Bug 1462248]. Added code temporarily suppress the use of TCL_ENCODING_END set when eof was reached while the buffer we are converting is not truly the last buffer in the queue. together with the Utf bug below it was possible to completely bollox the buffer data structures, eventually crashing Tcl. * generic/tclEncoding.c (UtfToUtfProc): Fixed problem where the function accessed memory beyond the end of the input buffer. When TCL_ENCODING_END is set and the last bytes of the buffer start a multi-byte sequence. This bug contributed to [SF Tcl Bug 1462248].