summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-19 14:57:45 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-19 14:57:45 (GMT)
commit2c75cac14e5195f484e885aa3c6e14dd11ce8e6d (patch)
tree44c61defb770ec092e1a1b1df86e4d6678603961
parenta0b87265cec0688fcea529d4afbe6397586e704b (diff)
parentfe3f8f0dbcfbca208a49abd28f9b0eb4179db722 (diff)
downloadtcl-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.c4
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);
}