зеркало из https://github.com/mozilla/pjs.git
Backed out changeset 0c5da403b68e
This commit is contained in:
Родитель
2464d6f4b4
Коммит
e88572be29
|
@ -52,7 +52,6 @@ HOST_PROGRAM = nsinstall$(HOST_BIN_SUFFIX)
|
||||||
|
|
||||||
ifeq (WINNT,$(HOST_OS_ARCH))
|
ifeq (WINNT,$(HOST_OS_ARCH))
|
||||||
HOST_CSRCS = nsinstall_win.c
|
HOST_CSRCS = nsinstall_win.c
|
||||||
HOST_EXTRA_LIBS = $(call EXPAND_LIBNAME,shlwapi)
|
|
||||||
else
|
else
|
||||||
HOST_CSRCS = nsinstall.c pathsub.c
|
HOST_CSRCS = nsinstall.c pathsub.c
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -738,7 +738,7 @@ endif # OS2
|
||||||
endif # NSINSTALL_BIN
|
endif # NSINSTALL_BIN
|
||||||
|
|
||||||
|
|
||||||
ifeq (,$(CROSS_COMPILE)$(filter-out OS2, $(OS_ARCH)))
|
ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2, $(OS_ARCH)))
|
||||||
INSTALL = $(NSINSTALL)
|
INSTALL = $(NSINSTALL)
|
||||||
else
|
else
|
||||||
ifeq ($(NSDISTMODE),copy)
|
ifeq ($(NSDISTMODE),copy)
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <shlwapi.h>
|
|
||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -27,30 +26,16 @@ typedef BOOL (*sh_FileFcn)(
|
||||||
wchar_t *pathName,
|
wchar_t *pathName,
|
||||||
WIN32_FIND_DATA *fileData,
|
WIN32_FIND_DATA *fileData,
|
||||||
void *arg);
|
void *arg);
|
||||||
typedef BOOL (*sh_DoFcn)(
|
|
||||||
wchar_t *srcFileName,
|
|
||||||
DWORD srcFileAttributes,
|
|
||||||
wchar_t *dstFileName,
|
|
||||||
DWORD dstFileAttributes,
|
|
||||||
int force,
|
|
||||||
int recursive);
|
|
||||||
|
|
||||||
static int shellDo (wchar_t **pArgv, sh_FileFcn, sh_DoFcn);
|
static int shellCp (wchar_t **pArgv);
|
||||||
static int shellNsinstall (wchar_t **pArgv);
|
static int shellNsinstall (wchar_t **pArgv);
|
||||||
static int shellMkdir (wchar_t **pArgv);
|
static int shellMkdir (wchar_t **pArgv);
|
||||||
static BOOL sh_EnumerateFiles(const wchar_t *pattern, const wchar_t *where,
|
static BOOL sh_EnumerateFiles(const wchar_t *pattern, const wchar_t *where,
|
||||||
sh_FileFcn fileFcn, void *arg, int *nFiles);
|
sh_FileFcn fileFcn, void *arg, int *nFiles);
|
||||||
static const char *sh_GetLastErrorMessage(void);
|
static const char *sh_GetLastErrorMessage(void);
|
||||||
static BOOL sh_DoLnk(wchar_t *srcFileName, DWORD srcFileAttributes,
|
|
||||||
wchar_t *dstFileName, DWORD dstFileAttributes,
|
|
||||||
int force, int recursive);
|
|
||||||
static BOOL sh_DoCopy(wchar_t *srcFileName, DWORD srcFileAttributes,
|
static BOOL sh_DoCopy(wchar_t *srcFileName, DWORD srcFileAttributes,
|
||||||
wchar_t *dstFileName, DWORD dstFileAttributes,
|
wchar_t *dstFileName, DWORD dstFileAttributes,
|
||||||
int force, int recursive);
|
int force, int recursive);
|
||||||
static BOOL sh_LnkFileCmd(wchar_t *pathName, WIN32_FIND_DATA *findData,
|
|
||||||
void *cpArg);
|
|
||||||
static BOOL sh_CpFileCmd(wchar_t *pathName, WIN32_FIND_DATA *findData,
|
|
||||||
void *cpArg);
|
|
||||||
|
|
||||||
#define LONGPATH_PREFIX L"\\\\?\\"
|
#define LONGPATH_PREFIX L"\\\\?\\"
|
||||||
#define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
|
#define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
|
||||||
|
@ -79,13 +64,12 @@ shellNsinstall (wchar_t **pArgv)
|
||||||
{
|
{
|
||||||
int retVal = 0; /* exit status */
|
int retVal = 0; /* exit status */
|
||||||
int dirOnly = 0; /* 1 if and only if -D is specified */
|
int dirOnly = 0; /* 1 if and only if -D is specified */
|
||||||
int linkFiles = 0; /* 1 iff -R is specified */
|
|
||||||
wchar_t **pSrc;
|
wchar_t **pSrc;
|
||||||
wchar_t **pDst;
|
wchar_t **pDst;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Process the command-line options. We ignore the
|
* Process the command-line options. We ignore the
|
||||||
* options except for -D and -R. Some options, such as -m,
|
* options except for -D. Some options, such as -m,
|
||||||
* are followed by an argument. We need to skip the
|
* are followed by an argument. We need to skip the
|
||||||
* argument too.
|
* argument too.
|
||||||
*/
|
*/
|
||||||
|
@ -94,8 +78,6 @@ shellNsinstall (wchar_t **pArgv)
|
||||||
|
|
||||||
if ( c == 'D' ) {
|
if ( c == 'D' ) {
|
||||||
dirOnly = 1;
|
dirOnly = 1;
|
||||||
} else if ( c == 'R' ) {
|
|
||||||
linkFiles = 1;
|
|
||||||
} else if ( c == 'm' ) {
|
} else if ( c == 'm' ) {
|
||||||
pArgv++; /* skip the next argument */
|
pArgv++; /* skip the next argument */
|
||||||
}
|
}
|
||||||
|
@ -129,13 +111,8 @@ shellNsinstall (wchar_t **pArgv)
|
||||||
retVal = shellMkdir ( pDst );
|
retVal = shellMkdir ( pDst );
|
||||||
if ( retVal )
|
if ( retVal )
|
||||||
return retVal;
|
return retVal;
|
||||||
if ( !dirOnly ) {
|
if ( !dirOnly )
|
||||||
if ( linkFiles) {
|
retVal = shellCp ( pSrc );
|
||||||
retVal = shellDo ( pSrc, sh_LnkFileCmd, sh_DoLnk );
|
|
||||||
} else {
|
|
||||||
retVal = shellDo ( pSrc, sh_CpFileCmd, sh_DoCopy );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,53 +225,6 @@ sh_RecordFileData(wchar_t *pathName, WIN32_FIND_DATA *findData, void *arg)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL
|
|
||||||
sh_DoLnk(wchar_t *srcFileName,
|
|
||||||
DWORD srcFileAttributes,
|
|
||||||
wchar_t *dstFileName,
|
|
||||||
DWORD dstFileAttributes,
|
|
||||||
int force,
|
|
||||||
int recursive
|
|
||||||
)
|
|
||||||
{
|
|
||||||
BOOL willDeleteFile = (dstFileAttributes != 0xFFFFFFFF) ? TRUE : FALSE;
|
|
||||||
|
|
||||||
if (srcFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
|
|
||||||
fprintf(stderr, "nsinstall: %ls is a directory\n",
|
|
||||||
srcFileName);
|
|
||||||
return FALSE;
|
|
||||||
} else {
|
|
||||||
DWORD r;
|
|
||||||
wchar_t longSrc[1004] = LONGPATH_PREFIX;
|
|
||||||
wchar_t longDst[1004] = LONGPATH_PREFIX;
|
|
||||||
r = GetFullPathName(srcFileName, 1000, longSrc + STR_LEN(LONGPATH_PREFIX), NULL);
|
|
||||||
if (!r) {
|
|
||||||
fprintf(stderr, "nsinstall: couldn't get full path of %ls: %s\n",
|
|
||||||
srcFileName, sh_GetLastErrorMessage());
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
r = GetFullPathName(dstFileName, 1000, longDst + ARRAY_LEN(LONGPATH_PREFIX) - 1, NULL);
|
|
||||||
if (!r) {
|
|
||||||
fprintf(stderr, "nsinstall: couldn't get full path of %ls: %s\n",
|
|
||||||
dstFileName, sh_GetLastErrorMessage());
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (willDeleteFile) {
|
|
||||||
DeleteFile(dstFileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!CreateHardLink(longDst, longSrc, NULL)) {
|
|
||||||
fprintf(stderr, "nsinstall: warning! cannot link %ls to %ls: %s\n",
|
|
||||||
srcFileName, dstFileName, sh_GetLastErrorMessage());
|
|
||||||
return sh_DoCopy(srcFileName, srcFileAttributes,
|
|
||||||
dstFileName, dstFileAttributes,
|
|
||||||
force, recursive);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOL
|
static BOOL
|
||||||
sh_DoCopy(wchar_t *srcFileName,
|
sh_DoCopy(wchar_t *srcFileName,
|
||||||
DWORD srcFileAttributes,
|
DWORD srcFileAttributes,
|
||||||
|
@ -333,8 +263,6 @@ sh_DoCopy(wchar_t *srcFileName,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CopyFile(longSrc, longDst, FALSE)) {
|
if (!CopyFile(longSrc, longDst, FALSE)) {
|
||||||
if (!wcscmp(PathFindExtension(longSrc), L".chk"))
|
|
||||||
return TRUE; // Incredibly ugly hack to work around Bug 539689
|
|
||||||
fprintf(stderr, "nsinstall: cannot copy %ls to %ls: %s\n",
|
fprintf(stderr, "nsinstall: cannot copy %ls to %ls: %s\n",
|
||||||
srcFileName, dstFileName, sh_GetLastErrorMessage());
|
srcFileName, dstFileName, sh_GetLastErrorMessage());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -388,20 +316,8 @@ sh_CpFileCmd(wchar_t *pathName, WIN32_FIND_DATA *findData, void *cpArg)
|
||||||
arg->force, arg->recursive);
|
arg->force, arg->recursive);
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL
|
|
||||||
sh_LnkFileCmd(wchar_t *pathName, WIN32_FIND_DATA *findData, void *cpArg)
|
|
||||||
{
|
|
||||||
BOOL retVal = TRUE;
|
|
||||||
struct sh_CpCmdArg *arg = (struct sh_CpCmdArg *) cpArg;
|
|
||||||
|
|
||||||
wcscpy(arg->dstFileNameMarker, findData->cFileName);
|
|
||||||
return sh_DoLnk(pathName, findData->dwFileAttributes,
|
|
||||||
arg->dstFileName, GetFileAttributes(arg->dstFileName),
|
|
||||||
arg->force, arg->recursive);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
shellDo (wchar_t **pArgv, sh_FileFcn doFooCmd, sh_DoFcn doFoo)
|
shellCp (wchar_t **pArgv)
|
||||||
{
|
{
|
||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
wchar_t **pSrc;
|
wchar_t **pSrc;
|
||||||
|
@ -537,7 +453,7 @@ shellDo (wchar_t **pArgv, sh_FileFcn doFooCmd, sh_DoFcn doFoo)
|
||||||
retVal = 3;
|
retVal = 3;
|
||||||
} else {
|
} else {
|
||||||
assert(n == 1);
|
assert(n == 1);
|
||||||
if ((*doFoo)(srcData.pathName, srcData.dwFileAttributes,
|
if (sh_DoCopy(srcData.pathName, srcData.dwFileAttributes,
|
||||||
dstData.pathName, dstData.dwFileAttributes,
|
dstData.pathName, dstData.dwFileAttributes,
|
||||||
arg.force, arg.recursive) == FALSE) {
|
arg.force, arg.recursive) == FALSE) {
|
||||||
retVal = 3;
|
retVal = 3;
|
||||||
|
@ -550,7 +466,7 @@ shellDo (wchar_t **pArgv, sh_FileFcn doFooCmd, sh_DoFcn doFoo)
|
||||||
BOOL rv;
|
BOOL rv;
|
||||||
|
|
||||||
changeForwardSlashesToBackSlashes(*pSrc);
|
changeForwardSlashesToBackSlashes(*pSrc);
|
||||||
rv = sh_EnumerateFiles(*pSrc, *pSrc, doFooCmd, &arg, &n);
|
rv = sh_EnumerateFiles(*pSrc, *pSrc, sh_CpFileCmd, &arg, &n);
|
||||||
if (rv == FALSE) {
|
if (rv == FALSE) {
|
||||||
retVal = 3;
|
retVal = 3;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -738,7 +738,7 @@ endif # OS2
|
||||||
endif # NSINSTALL_BIN
|
endif # NSINSTALL_BIN
|
||||||
|
|
||||||
|
|
||||||
ifeq (,$(CROSS_COMPILE)$(filter-out OS2, $(OS_ARCH)))
|
ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2, $(OS_ARCH)))
|
||||||
INSTALL = $(NSINSTALL)
|
INSTALL = $(NSINSTALL)
|
||||||
else
|
else
|
||||||
ifeq ($(NSDISTMODE),copy)
|
ifeq ($(NSDISTMODE),copy)
|
||||||
|
|
|
@ -26,30 +26,16 @@ typedef BOOL (*sh_FileFcn)(
|
||||||
wchar_t *pathName,
|
wchar_t *pathName,
|
||||||
WIN32_FIND_DATA *fileData,
|
WIN32_FIND_DATA *fileData,
|
||||||
void *arg);
|
void *arg);
|
||||||
typedef BOOL (*sh_DoFcn)(
|
|
||||||
wchar_t *srcFileName,
|
|
||||||
DWORD srcFileAttributes,
|
|
||||||
wchar_t *dstFileName,
|
|
||||||
DWORD dstFileAttributes,
|
|
||||||
int force,
|
|
||||||
int recursive);
|
|
||||||
|
|
||||||
static int shellDo (wchar_t **pArgv, sh_FileFcn, sh_DoFcn);
|
static int shellCp (wchar_t **pArgv);
|
||||||
static int shellNsinstall (wchar_t **pArgv);
|
static int shellNsinstall (wchar_t **pArgv);
|
||||||
static int shellMkdir (wchar_t **pArgv);
|
static int shellMkdir (wchar_t **pArgv);
|
||||||
static BOOL sh_EnumerateFiles(const wchar_t *pattern, const wchar_t *where,
|
static BOOL sh_EnumerateFiles(const wchar_t *pattern, const wchar_t *where,
|
||||||
sh_FileFcn fileFcn, void *arg, int *nFiles);
|
sh_FileFcn fileFcn, void *arg, int *nFiles);
|
||||||
static const char *sh_GetLastErrorMessage(void);
|
static const char *sh_GetLastErrorMessage(void);
|
||||||
static BOOL sh_DoLnk(wchar_t *srcFileName, DWORD srcFileAttributes,
|
|
||||||
wchar_t *dstFileName, DWORD dstFileAttributes,
|
|
||||||
int force, int recursive);
|
|
||||||
static BOOL sh_DoCopy(wchar_t *srcFileName, DWORD srcFileAttributes,
|
static BOOL sh_DoCopy(wchar_t *srcFileName, DWORD srcFileAttributes,
|
||||||
wchar_t *dstFileName, DWORD dstFileAttributes,
|
wchar_t *dstFileName, DWORD dstFileAttributes,
|
||||||
int force, int recursive);
|
int force, int recursive);
|
||||||
static BOOL sh_LnkFileCmd(wchar_t *pathName, WIN32_FIND_DATA *findData,
|
|
||||||
void *cpArg);
|
|
||||||
static BOOL sh_CpFileCmd(wchar_t *pathName, WIN32_FIND_DATA *findData,
|
|
||||||
void *cpArg);
|
|
||||||
|
|
||||||
#define LONGPATH_PREFIX L"\\\\?\\"
|
#define LONGPATH_PREFIX L"\\\\?\\"
|
||||||
#define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
|
#define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
|
||||||
|
@ -78,13 +64,12 @@ shellNsinstall (wchar_t **pArgv)
|
||||||
{
|
{
|
||||||
int retVal = 0; /* exit status */
|
int retVal = 0; /* exit status */
|
||||||
int dirOnly = 0; /* 1 if and only if -D is specified */
|
int dirOnly = 0; /* 1 if and only if -D is specified */
|
||||||
int linkFiles = 0; /* 1 iff -R is specified */
|
|
||||||
wchar_t **pSrc;
|
wchar_t **pSrc;
|
||||||
wchar_t **pDst;
|
wchar_t **pDst;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Process the command-line options. We ignore the
|
* Process the command-line options. We ignore the
|
||||||
* options except for -D and -R. Some options, such as -m,
|
* options except for -D. Some options, such as -m,
|
||||||
* are followed by an argument. We need to skip the
|
* are followed by an argument. We need to skip the
|
||||||
* argument too.
|
* argument too.
|
||||||
*/
|
*/
|
||||||
|
@ -93,8 +78,6 @@ shellNsinstall (wchar_t **pArgv)
|
||||||
|
|
||||||
if ( c == 'D' ) {
|
if ( c == 'D' ) {
|
||||||
dirOnly = 1;
|
dirOnly = 1;
|
||||||
} else if ( c == 'R' ) {
|
|
||||||
linkFiles = 1;
|
|
||||||
} else if ( c == 'm' ) {
|
} else if ( c == 'm' ) {
|
||||||
pArgv++; /* skip the next argument */
|
pArgv++; /* skip the next argument */
|
||||||
}
|
}
|
||||||
|
@ -128,13 +111,8 @@ shellNsinstall (wchar_t **pArgv)
|
||||||
retVal = shellMkdir ( pDst );
|
retVal = shellMkdir ( pDst );
|
||||||
if ( retVal )
|
if ( retVal )
|
||||||
return retVal;
|
return retVal;
|
||||||
if ( !dirOnly ) {
|
if ( !dirOnly )
|
||||||
if ( linkFiles) {
|
retVal = shellCp ( pSrc );
|
||||||
retVal = shellDo ( pSrc, sh_LnkFileCmd, sh_DoLnk );
|
|
||||||
} else {
|
|
||||||
retVal = shellDo ( pSrc, sh_CpFileCmd, sh_DoCopy );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,53 +225,6 @@ sh_RecordFileData(wchar_t *pathName, WIN32_FIND_DATA *findData, void *arg)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL
|
|
||||||
sh_DoLnk(wchar_t *srcFileName,
|
|
||||||
DWORD srcFileAttributes,
|
|
||||||
wchar_t *dstFileName,
|
|
||||||
DWORD dstFileAttributes,
|
|
||||||
int force,
|
|
||||||
int recursive
|
|
||||||
)
|
|
||||||
{
|
|
||||||
BOOL willDeleteFile = (dstFileAttributes != 0xFFFFFFFF) ? TRUE : FALSE;
|
|
||||||
|
|
||||||
if (srcFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
|
|
||||||
fprintf(stderr, "nsinstall: %ls is a directory\n",
|
|
||||||
srcFileName);
|
|
||||||
return FALSE;
|
|
||||||
} else {
|
|
||||||
DWORD r;
|
|
||||||
wchar_t longSrc[1004] = LONGPATH_PREFIX;
|
|
||||||
wchar_t longDst[1004] = LONGPATH_PREFIX;
|
|
||||||
r = GetFullPathName(srcFileName, 1000, longSrc + STR_LEN(LONGPATH_PREFIX), NULL);
|
|
||||||
if (!r) {
|
|
||||||
fprintf(stderr, "nsinstall: couldn't get full path of %ls: %s\n",
|
|
||||||
srcFileName, sh_GetLastErrorMessage());
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
r = GetFullPathName(dstFileName, 1000, longDst + ARRAY_LEN(LONGPATH_PREFIX) - 1, NULL);
|
|
||||||
if (!r) {
|
|
||||||
fprintf(stderr, "nsinstall: couldn't get full path of %ls: %s\n",
|
|
||||||
dstFileName, sh_GetLastErrorMessage());
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (willDeleteFile) {
|
|
||||||
DeleteFile(dstFileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!CreateHardLink(longDst, longSrc, NULL)) {
|
|
||||||
fprintf(stderr, "nsinstall: warning! cannot link %ls to %ls: %s\n",
|
|
||||||
srcFileName, dstFileName, sh_GetLastErrorMessage());
|
|
||||||
return sh_DoCopy(srcFileName, srcFileAttributes,
|
|
||||||
dstFileName, dstFileAttributes,
|
|
||||||
force, recursive);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOL
|
static BOOL
|
||||||
sh_DoCopy(wchar_t *srcFileName,
|
sh_DoCopy(wchar_t *srcFileName,
|
||||||
DWORD srcFileAttributes,
|
DWORD srcFileAttributes,
|
||||||
|
@ -385,20 +316,8 @@ sh_CpFileCmd(wchar_t *pathName, WIN32_FIND_DATA *findData, void *cpArg)
|
||||||
arg->force, arg->recursive);
|
arg->force, arg->recursive);
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL
|
|
||||||
sh_LnkFileCmd(wchar_t *pathName, WIN32_FIND_DATA *findData, void *cpArg)
|
|
||||||
{
|
|
||||||
BOOL retVal = TRUE;
|
|
||||||
struct sh_CpCmdArg *arg = (struct sh_CpCmdArg *) cpArg;
|
|
||||||
|
|
||||||
wcscpy(arg->dstFileNameMarker, findData->cFileName);
|
|
||||||
return sh_DoLnk(pathName, findData->dwFileAttributes,
|
|
||||||
arg->dstFileName, GetFileAttributes(arg->dstFileName),
|
|
||||||
arg->force, arg->recursive);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
shellDo (wchar_t **pArgv, sh_FileFcn doFooCmd, sh_DoFcn doFoo)
|
shellCp (wchar_t **pArgv)
|
||||||
{
|
{
|
||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
wchar_t **pSrc;
|
wchar_t **pSrc;
|
||||||
|
@ -534,7 +453,7 @@ shellDo (wchar_t **pArgv, sh_FileFcn doFooCmd, sh_DoFcn doFoo)
|
||||||
retVal = 3;
|
retVal = 3;
|
||||||
} else {
|
} else {
|
||||||
assert(n == 1);
|
assert(n == 1);
|
||||||
if ((*doFoo)(srcData.pathName, srcData.dwFileAttributes,
|
if (sh_DoCopy(srcData.pathName, srcData.dwFileAttributes,
|
||||||
dstData.pathName, dstData.dwFileAttributes,
|
dstData.pathName, dstData.dwFileAttributes,
|
||||||
arg.force, arg.recursive) == FALSE) {
|
arg.force, arg.recursive) == FALSE) {
|
||||||
retVal = 3;
|
retVal = 3;
|
||||||
|
@ -547,7 +466,7 @@ shellDo (wchar_t **pArgv, sh_FileFcn doFooCmd, sh_DoFcn doFoo)
|
||||||
BOOL rv;
|
BOOL rv;
|
||||||
|
|
||||||
changeForwardSlashesToBackSlashes(*pSrc);
|
changeForwardSlashesToBackSlashes(*pSrc);
|
||||||
rv = sh_EnumerateFiles(*pSrc, *pSrc, doFooCmd, &arg, &n);
|
rv = sh_EnumerateFiles(*pSrc, *pSrc, sh_CpFileCmd, &arg, &n);
|
||||||
if (rv == FALSE) {
|
if (rv == FALSE) {
|
||||||
retVal = 3;
|
retVal = 3;
|
||||||
} else {
|
} else {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче