From 8d9b2e3c6958e5856b03a00694b8ae02817ed002 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Sun, 12 Jul 1998 06:38:27 +0000 Subject: various tweaks for PERL_OBJECT build & test p4raw-id: //depot/perl@1450 --- win32/win32.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'win32/win32.c') diff --git a/win32/win32.c b/win32/win32.c index 24f42f7e35..7418fcacee 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1732,18 +1732,18 @@ win32_pclose(FILE *pf) } DllExport int -win32_rename(const char *oldname, const char *newname) +win32_rename(const char *oname, const char *newname) { char szNewWorkName[MAX_PATH+1]; WIN32_FIND_DATA fdOldFile, fdNewFile; HANDLE handle; char *ptr; - if ((strchr(oldname, '\\') || strchr(oldname, '/')) + if ((strchr(oname, '\\') || strchr(oname, '/')) && strchr(newname, '\\') == NULL && strchr(newname, '/') == NULL) { - strcpy(szNewWorkName, oldname); + strcpy(szNewWorkName, oname); if ((ptr = strrchr(szNewWorkName, '\\')) == NULL) ptr = strrchr(szNewWorkName, '/'); strcpy(++ptr, newname); @@ -1751,14 +1751,14 @@ win32_rename(const char *oldname, const char *newname) else strcpy(szNewWorkName, newname); - if (stricmp(oldname, szNewWorkName) != 0) { + if (stricmp(oname, szNewWorkName) != 0) { // check that we're not being fooled by relative paths // and only delete the new file // 1) if it exists // 2) it is not the same file as the old file // 3) old file exist // GetFullPathName does not return the long file name on some systems - handle = FindFirstFile(oldname, &fdOldFile); + handle = FindFirstFile(oname, &fdOldFile); if (handle != INVALID_HANDLE_VALUE) { FindClose(handle); @@ -1778,7 +1778,7 @@ win32_rename(const char *oldname, const char *newname) } } } - return rename(oldname, newname); + return rename(oname, newname); } DllExport int -- cgit v1.2.1