diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-03-19 14:57:45 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-03-19 14:57:45 (GMT) |
commit | c84291cb33b37dadd921f07779f92acc5ea2146c (patch) | |
tree | 44c61defb770ec092e1a1b1df86e4d6678603961 /win | |
parent | c82a99d9c150ac245f6d3e1131ff7babdda85ea0 (diff) | |
parent | 5240a88aa55a77abb6e62d887b7f28e8ed89076f (diff) | |
download | tcl-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!)
Diffstat (limited to 'win')
-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 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); } |