diff options
author | nijtmans <nijtmans> | 2010-08-14 17:13:02 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-08-14 17:13:02 (GMT) |
commit | bcc427ce10a994d6f852f8a4a3a47bd706317581 (patch) | |
tree | 4f5a2412e887b345c272cf9e43755763e7a3922f /win | |
parent | d2976f0d8219a1841117e8e004c5bbe21c812961 (diff) | |
download | tcl-bcc427ce10a994d6f852f8a4a3a47bd706317581.zip tcl-bcc427ce10a994d6f852f8a4a3a47bd706317581.tar.gz tcl-bcc427ce10a994d6f852f8a4a3a47bd706317581.tar.bz2 |
[Patch #2994165] Change signature of Tcl_FSGetNativePath and TclpDeleteFile
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinFCmd.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c index 89cb59f..fd5cd5d 100644 --- a/win/tclWinFCmd.c +++ b/win/tclWinFCmd.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinFCmd.c,v 1.62 2010/04/22 11:40:32 nijtmans Exp $ + * RCS: @(#) $Id: tclWinFCmd.c,v 1.63 2010/08/14 17:13:02 nijtmans Exp $ */ #include "tclWinInt.h" @@ -766,34 +766,35 @@ TclpObjDeleteFile( int TclpDeleteFile( - const TCHAR *nativePath) /* Pathname of file to be removed (native). */ + const void *nativePath) /* Pathname of file to be removed (native). */ { DWORD attr; + const TCHAR *path = nativePath; /* * The DeleteFile API acts differently under Win95/98 and NT WRT NULL and * "". Avoid passing these values. */ - if (nativePath == NULL || nativePath[0] == '\0') { + if (path == NULL || path[0] == '\0') { Tcl_SetErrno(ENOENT); return TCL_ERROR; } - if (tclWinProcs->deleteFileProc(nativePath) != FALSE) { + if (tclWinProcs->deleteFileProc(path) != FALSE) { return TCL_OK; } TclWinConvertError(GetLastError()); if (Tcl_GetErrno() == EACCES) { - attr = tclWinProcs->getFileAttributesProc(nativePath); + attr = tclWinProcs->getFileAttributesProc(path); if (attr != 0xffffffff) { if (attr & FILE_ATTRIBUTE_DIRECTORY) { if (attr & FILE_ATTRIBUTE_REPARSE_POINT) { /* * It is a symbolic link - remove it. */ - if (TclWinSymLinkDelete(nativePath, 0) == 0) { + if (TclWinSymLinkDelete(path, 0) == 0) { return TCL_OK; } } @@ -807,21 +808,21 @@ TclpDeleteFile( Tcl_SetErrno(EISDIR); } else if (attr & FILE_ATTRIBUTE_READONLY) { - int res = tclWinProcs->setFileAttributesProc(nativePath, + int res = tclWinProcs->setFileAttributesProc(path, attr & ~((DWORD) FILE_ATTRIBUTE_READONLY)); if ((res != 0) && - (tclWinProcs->deleteFileProc(nativePath) != FALSE)) { + (tclWinProcs->deleteFileProc(path) != FALSE)) { return TCL_OK; } TclWinConvertError(GetLastError()); if (res != 0) { - tclWinProcs->setFileAttributesProc(nativePath, attr); + tclWinProcs->setFileAttributesProc(path, attr); } } } } else if (Tcl_GetErrno() == ENOENT) { - attr = tclWinProcs->getFileAttributesProc(nativePath); + attr = tclWinProcs->getFileAttributesProc(path); if (attr != 0xffffffff) { if (attr & FILE_ATTRIBUTE_DIRECTORY) { /* |