diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-03-31 18:47:26 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-03-31 18:47:26 (GMT) |
commit | 7e30bd73bdf1406fbbff99255256f0b9d2ba0181 (patch) | |
tree | 412d59b079017abb778b9483c6d182a31216e9fa /win | |
parent | 92bec6e359c2f911e7d60eaa4dd21d2cefa0db09 (diff) | |
parent | f4cedcbce197fa8bedcd0bdbff05b9434adef7b4 (diff) | |
download | tcl-7e30bd73bdf1406fbbff99255256f0b9d2ba0181.zip tcl-7e30bd73bdf1406fbbff99255256f0b9d2ba0181.tar.gz tcl-7e30bd73bdf1406fbbff99255256f0b9d2ba0181.tar.bz2 |
merge trunk
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinChan.c | 4 | ||||
-rw-r--r-- | win/tclWinConsole.c | 7 | ||||
-rw-r--r-- | win/tclWinFCmd.c | 7 | ||||
-rw-r--r-- | win/tclWinPipe.c | 6 |
4 files changed, 21 insertions, 3 deletions
diff --git a/win/tclWinChan.c b/win/tclWinChan.c index 24bfb5f..241276a 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -662,6 +662,10 @@ FileInputProc( *errorCode = 0; /* + * TODO: This comment appears to be out of date. We *do* have a + * console driver, over in tclWinConsole.c. After some Windows + * developer confirms, this comment should be revised. + * * Note that we will block on reads from a console buffer until a full * line has been entered. The only way I know of to get around this is to * write a console driver. We should probably do this at some point, but diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c index bd7f0e3..b8c4782 100644 --- a/win/tclWinConsole.c +++ b/win/tclWinConsole.c @@ -756,6 +756,13 @@ ConsoleInputProc( if (ReadConsoleBytes(infoPtr->handle, (LPVOID) buf, (DWORD) bufSize, &count) == TRUE) { + /* + * TODO: This potentially writes beyond the limits specified + * by the caller. In practice this is harmless, since all writes + * are into ChannelBuffers, and those have padding, but still + * ought to remove this, unless some Windows wizard can give + * a reason not to. + */ buf[count] = '\0'; return count; } diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c index 042fe67..0803175 100644 --- a/win/tclWinFCmd.c +++ b/win/tclWinFCmd.c @@ -1825,12 +1825,12 @@ SetWinFileAttributes( Tcl_Obj *fileName, /* The name of the file. */ Tcl_Obj *attributePtr) /* The new value of the attribute. */ { - DWORD fileAttributes; + DWORD fileAttributes, old; int yesNo, result; const TCHAR *nativeName; nativeName = Tcl_FSGetNativePath(fileName); - fileAttributes = GetFileAttributes(nativeName); + fileAttributes = old = GetFileAttributes(nativeName); if (fileAttributes == 0xffffffff) { StatError(interp, fileName); @@ -1848,7 +1848,8 @@ SetWinFileAttributes( fileAttributes &= ~(attributeArray[objIndex]); } - if (!SetFileAttributes(nativeName, fileAttributes)) { + if ((fileAttributes != old) + && !SetFileAttributes(nativeName, fileAttributes)) { StatError(interp, fileName); return TCL_ERROR; } diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index b0e830f..33493ae 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -82,6 +82,12 @@ static ProcInfo *procList; #define PIPE_EXTRABYTE (1<<3) /* The reader thread has consumed one byte. */ /* + * TODO: It appears the whole EXTRABYTE machinery is in place to support + * outdated Win 95 systems. If this can be confirmed, much code can be + * deleted. + */ + +/* * This structure describes per-instance data for a pipe based channel. */ |