diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-03-19 14:57:45 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-03-19 14:57:45 (GMT) |
commit | 2c75cac14e5195f484e885aa3c6e14dd11ce8e6d (patch) | |
tree | 44c61defb770ec092e1a1b1df86e4d6678603961 | |
parent | a0b87265cec0688fcea529d4afbe6397586e704b (diff) | |
parent | fe3f8f0dbcfbca208a49abd28f9b0eb4179db722 (diff) | |
download | tcl-2c75cac14e5195f484e885aa3c6e14dd11ce8e6d.zip tcl-2c75cac14e5195f484e885aa3c6e14dd11ce8e6d.tar.gz tcl-2c75cac14e5195f484e885aa3c6e14dd11ce8e6d.tar.bz2 |
Handle the (unlikely) case that the file is deleted in between. Suggested by Harald Oehlmann (Thanks!)
-rw-r--r-- | win/tclWinFile.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c index b5e104f..d4e8ce7 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -2058,6 +2058,10 @@ NativeStat( return -1; } hFind = (*tclWinProcs->findFirstFileProc)(nativePath, &ffd); + if (hFind == INVALID_HANDLE_VALUE) { + TclWinConvertError(lasterror); + return -1; + } memcpy(&data, &ffd, sizeof(data)); FindClose(hFind); } |