333{
335 INT argc,
i, nFiles, nOverwrite = 0, nSrc = -1, nDes = -1;
336
340
345
346 TCHAR * appendPointer =
_T(
"\0");
347
350
352
354
359
361
362
363
365 {
367 return 0;
368 }
369
371
372
376 else
378
380 {
381 TCHAR *old_evar = evar;
385 else
386 {
388 evar = old_evar;
389 }
390 }
391
392
394 {
396
397
399 {
401 {
404 }
406 {
409 }
411 {
414 }
416 {
419 }
421 {
424 }
426 {
429 }
431 {
434 }
436 {
439 }
440 }
441 }
443
444
445
448
449
451 {
453 {
455 {
457 {
460 break;
461
464 break;
465
468 break;
469
472 break;
473
476 break;
477
481 break;
482
485 {
487 {
490 }
491 }
492
493 break;
494
497 break;
498
499 default:
500
504 return 1;
505 break;
506 }
507 }
508
509 nFiles--;
510 }
511 else
512 {
513
514 if (nSrc == -1)
515 {
517 }
518 else if (*
arg[
i] ==
_T(
'+'))
519 {
520
522 nFiles -= 1;
523 }
524 else if (bMoreFiles)
525 {
526
527
528
533 {
539 nFiles -= 1;
540 }
541
543 }
544 else if (nDes == -1)
545 {
547 }
548 }
549 }
550
551
553 {
556 }
557
558 if (nFiles < 1)
559 {
560
563 return 1;
564 }
565
566 if (nFiles > 2)
567 {
568
572 return 1;
573 }
574
579 {
580 bMultipleSource =
TRUE;
581 }
582
583
584 nFiles = 0;
585
586
587 if (nDes == -1)
588 {
589
590
592 }
593 else
594 {
595
596 if ((
arg[nDes][1] ==
_T(
':')) && (
arg[nDes][2] ==
_T(
'\0')))
597 {
599 }
600 else
601 {
602
604 }
605
606
609 {
610 bMultipleDest =
TRUE;
611 if (szDestPath[
_tcslen(szDestPath) - 1] !=
_T(
'\\'))
613 }
614
615
618 {
619 bMultipleDest =
TRUE;
620 }
621 }
622
623 if (nDes != -1)
624 {
625 if (bMultipleSource && !bMultipleDest)
626 {
627
628
631 appendPointer =
arg[nSrc];
632 }
633 }
634
635
637 if (UseThisName)
638 {
639
640 *UseThisName++ =
_T(
'\0');
641
642
643 if (((UseThisName[0] ==
_T(
'*')) && (UseThisName[1] ==
_T(
'\0'))) ||
644 (UseThisName[0] ==
_T(
'\0')))
645 {
646
647
650 }
651 }
652 else
653 {
654
655 UseThisName = szDestPath;
656 }
657
658 do
659 {
660
662 {
663
664 szSrcPath[0] =
_T(
'\0');
665
666
667
669 {
670 if (appendPointer[0] ==
_T(
'|'))
671 {
672
673 appendPointer++;
674 break;
675 }
676 else if (appendPointer[0] ==
_T(
'\0'))
677 {
679 break;
680 }
681
682 _tcsncat(szSrcPath, appendPointer, 1);
683 appendPointer++;
684 }
685
687 {
688
689
690
692 if (
_tcsncmp(szTouch,
_T(
"|,,\0"), 4) || (nDes != -1))
693 {
697 return 1;
698 }
701 }
702 }
703 else
704 {
707 }
708
709
710 if ((szSrcPath[1] ==
_T(
':')) && (szSrcPath[2] ==
_T(
'\0')))
711 {
715 break;
716 }
717
718
719
720
721
722
724
725
726
727
729 {
730
731 if (szSrcPath[
_tcslen(szSrcPath) - 1] !=
_T(
'\\'))
735 }
736
737
738 if (szSrcPath[
_tcslen(szSrcPath) - 1] ==
_T(
'\\'))
739 {
742 }
743
744
746
747
749 {
750
751 if (bMultipleSource)
753
757 return 1;
758 }
759
760
761 for (
i = (
_tcslen(szSrcPath) - 1);
i > -1;
i--)
762 {
763 if (szSrcPath[
i] !=
_T(
'\\'))
764 szSrcPath[
i] =
_T(
'\0');
765 else
766 break;
767 }
768
769 do
770 {
771
773 {
776 return 1;
777 }
778
779
780 nOverwrite = 1;
781
782
783 if (!
_tcscmp(findBuffer.cFileName,
_T(
".")) ||
784 !
_tcscmp(findBuffer.cFileName,
_T(
"..")) ||
786 {
787 continue;
788 }
789
790
791 _tcscpy(tmpDestPath, szDestPath);
793
794
795 if (
_tcscmp(tmpDestPath,
_T(
"\\\\.\\")) &&
797 {
802 return 1;
803 }
804
805
806 if (bSrcName)
807 _tcscat(tmpDestPath, findBuffer.cFileName);
808 else
809 {
810
813 {
814 _tcscat(tmpDestPath, UseThisName);
815 }
816 else
817 {
819
821 UseThisName,
822 DoneFile);
823
824
825
826 _tcscat(tmpDestPath, DoneFile);
827 }
828 }
829
830
832 _tcscat (tmpSrcPath, findBuffer.cFileName);
833
834
835 if (!bTouch && !
_tcscmp(tmpSrcPath, tmpDestPath))
836 {
838
840 break;
841 }
842
843
844 if (bMultipleSource)
846
847
851 continue;
854
855
856 if (
copy(tmpSrcPath,tmpDestPath, bAppend,
dwFlags, bTouch))
857 {
858 nFiles++;
859 }
860 else
861 {
862
866 }
867
868
870
872
873
874 } while (!bDone);
875
876
878
881
882 return 0;
883}
#define STRING_ERROR_INVALID_PARAM_FORMAT
#define STRING_COPY_ERROR3
VOID ConOutResPaging(BOOL StartPaging, UINT resID)
#define ConOutPrintf(szStr,...)
#define ConErrResPrintf(uID,...)
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
static INT CopyOverwrite(LPTSTR fn)
static void BuildFileName(LPTSTR pszSource, LPTSTR pszTarget, LPTSTR pszOutput)
#define STRING_COPY_HELP2
#define STRING_COPY_ERROR2
#define STRING_ERROR_INVALID_SWITCH
#define STRING_ERROR_TOO_MANY_PARAMETERS
#define STRING_ERROR_REQ_PARAM_MISSING
static VOID freep(LPSTR *p)
static LPSTR * split(LPSTR s, LPINT args)
#define cmd_realloc(ptr, size)
#define INVALID_HANDLE_VALUE
BOOL WINAPI FindClose(HANDLE hFindFile)
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define ERROR_FILE_NOT_FOUND
#define FILE_ATTRIBUTE_DIRECTORY
BOOL IsExistingDirectory(IN LPCTSTR pszPath)
BOOL IsExistingFile(IN LPCTSTR pszPath)
INT GetRootPath(IN LPCTSTR InPath, OUT LPTSTR OutPath, IN INT size)
#define ConOutResPrintf(uID,...)
#define ConOutFormatMessage(MessageId,...)
#define ConOutResPuts(uID)
#define GetEnvironmentVariable
DWORD WINAPI GetLastError(void)
#define GetCurrentDirectory
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags