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)
commitc84291cb33b37dadd921f07779f92acc5ea2146c (patch)
tree44c61defb770ec092e1a1b1df86e4d6678603961
parentc82a99d9c150ac245f6d3e1131ff7babdda85ea0 (diff)
parent5240a88aa55a77abb6e62d887b7f28e8ed89076f (diff)
downloadtcl-c84291cb33b37dadd921f07779f92acc5ea2146c.zip
tcl-c84291cb33b37dadd921f07779f92acc5ea2146c.tar.gz
tcl-c84291cb33b37dadd921f07779f92acc5ea2146c.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);
}