diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-03-19 14:59:26 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-03-19 14:59:26 (GMT) |
commit | 0ac1b15c03c0b5514d6b113140c89192d5db5ab5 (patch) | |
tree | 02dc56e7f44d3f4413283e6db05204b61ab4a8b4 | |
parent | c310129d42dd35b9a5fc585d1b0d93e6656c2a97 (diff) | |
parent | c84291cb33b37dadd921f07779f92acc5ea2146c (diff) | |
download | tcl-0ac1b15c03c0b5514d6b113140c89192d5db5ab5.zip tcl-0ac1b15c03c0b5514d6b113140c89192d5db5ab5.tar.gz tcl-0ac1b15c03c0b5514d6b113140c89192d5db5ab5.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 528b9e5..79ba40a 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -2006,6 +2006,10 @@ NativeStat( return -1; } hFind = FindFirstFile(nativePath, &ffd); + if (hFind == INVALID_HANDLE_VALUE) { + TclWinConvertError(lasterror); + return -1; + } memcpy(&data, &ffd, sizeof(data)); FindClose(hFind); } |