summaryrefslogtreecommitdiffstats
path: root/win/tclWinFile.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tclWinFile.c')
-rw-r--r--win/tclWinFile.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index df1c25b..f0f3bb0 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -252,9 +252,7 @@ WinLink(
* It is a file.
*/
- if (CreateHardLink == NULL) {
- Tcl_SetErrno(ENOTDIR);
- } else if (linkAction & TCL_CREATE_HARD_LINK) {
+ if (linkAction & TCL_CREATE_HARD_LINK) {
if (CreateHardLink(linkSourcePath, linkTargetPath, NULL)) {
/*
* Success!
@@ -925,24 +923,16 @@ TclpMatchInDirectory(
int len;
DWORD attr;
+ WIN32_FILE_ATTRIBUTE_DATA data;
const char *str = Tcl_GetStringFromObj(norm,&len);
native = Tcl_FSGetNativePath(pathPtr);
- if (GetFileAttributesEx == NULL) {
- attr = GetFileAttributes(native);
- if (attr == INVALID_FILE_ATTRIBUTES) {
- return TCL_OK;
- }
- } else {
- WIN32_FILE_ATTRIBUTE_DATA data;
-
- if (GetFileAttributesEx(native,
- GetFileExInfoStandard, &data) != TRUE) {
- return TCL_OK;
- }
- attr = data.dwFileAttributes;
+ if (GetFileAttributesEx(native,
+ GetFileExInfoStandard, &data) != TRUE) {
+ return TCL_OK;
}
+ attr = data.dwFileAttributes;
if (NativeMatchType(WinIsDrive(str,len), attr, native, types)) {
Tcl_ListObjAppendElement(interp, resultPtr, pathPtr);
@@ -1023,8 +1013,7 @@ TclpMatchInDirectory(
}
native = Tcl_WinUtfToTChar(dirName, -1, &ds);
- if (FindFirstFileEx == NULL || (types == NULL)
- || (types->type != TCL_GLOB_TYPE_DIR)) {
+ if ((types == NULL) || (types->type != TCL_GLOB_TYPE_DIR)) {
handle = FindFirstFile(native, &data);
} else {
/*