summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-19 14:55:47 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-19 14:55:47 (GMT)
commit5240a88aa55a77abb6e62d887b7f28e8ed89076f (patch)
treefc808e2d2b49757f4b55b024665434ad0cbe8ec2
parenta515c79f52c3d0927a7377700467074b80b8d169 (diff)
downloadtcl-5240a88aa55a77abb6e62d887b7f28e8ed89076f.zip
tcl-5240a88aa55a77abb6e62d887b7f28e8ed89076f.tar.gz
tcl-5240a88aa55a77abb6e62d887b7f28e8ed89076f.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 22fc6f3..462de4b 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -1901,6 +1901,10 @@ NativeStat(nativePath, statPtr, checkLinks)
return -1;
}
hFind = (*tclWinProcs->findFirstFileProc)(nativePath, &ffd);
+ if (hFind == INVALID_HANDLE_VALUE) {
+ TclWinConvertError(lasterror);
+ return -1;
+ }
memcpy(&data, &ffd, sizeof(data));
FindClose(hFind);
}