Compare commits

...
1 Commits
Author SHA1 Message Date
dkf 94f428af99 Check for wildcards if we've used FindFirstFile inside NativeAccess. 2013-03-19 11:48:34 +00:00
+17 -6
View File
@@ -1538,15 +1538,26 @@ NativeAccess(
*/
WIN32_FIND_DATA ffd;
HANDLE hFind;
hFind = FindFirstFile(nativePath, &ffd);
if (hFind != INVALID_HANDLE_VALUE) {
attr = ffd.dwFileAttributes;
FindClose(hFind);
} else {
HANDLE hFind = FindFirstFile(nativePath, &ffd);
if (hFind == INVALID_HANDLE_VALUE) {
TclWinConvertError(GetLastError());
return -1;
}
attr = ffd.dwFileAttributes;
FindClose(hFind);
/*
* Take care! Some characters are illegal in a filename, but legal in
* a search for a filename because they are wildcards. If there's one
* of those, we are still in an error case! [Bug 3608360]
*/
if (_tcspbrk(nativePath, _T("?*")) != NULL) {
Tcl_SetErrno(EEXIST);
return -1;
}
}
if (mode == F_OK) {