summaryrefslogtreecommitdiffstats
path: root/win/tclWinFile.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-19 14:59:26 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-19 14:59:26 (GMT)
commit0ac1b15c03c0b5514d6b113140c89192d5db5ab5 (patch)
tree02dc56e7f44d3f4413283e6db05204b61ab4a8b4 /win/tclWinFile.c
parentc310129d42dd35b9a5fc585d1b0d93e6656c2a97 (diff)
parentc84291cb33b37dadd921f07779f92acc5ea2146c (diff)
downloadtcl-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!)
Diffstat (limited to 'win/tclWinFile.c')
-rw-r--r--win/tclWinFile.c4
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);
}