diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-11-09 16:06:45 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-11-09 16:06:45 +0100 |
| commit | a2bfc5e9f4c66db6a29810c064b981d772aefb2a (patch) | |
| tree | 7ea6efd4ffe7e265a9dee447693e36332e36f375 /UCore.pas | |
| parent | 8712e487d22e7650a3dc529a63a70cf1d64e1bc4 (diff) | |
| download | tuxcmd-a2bfc5e9f4c66db6a29810c064b981d772aefb2a.tar.xz | |
Port CRC32 and MD5 functions to standard FreePascal RTL
Added compat dir for Kylix compatibility
Diffstat (limited to 'UCore.pas')
| -rw-r--r-- | UCore.pas | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -241,7 +241,8 @@ var LeftLocalEngine, RightLocalEngine: TPanelEngine; implementation (********************************************************************************************************************************) uses SysUtils, DateUtils, StrUtils, UConfig, UDirDelete, UOverwrite, ULocale, - UNewDir, UFileAssoc, USymlink, UCoreClasses, URemoteWait, UMain, UGnome; + UNewDir, UFileAssoc, USymlink, UCoreClasses, URemoteWait, UMain, UGnome, + crc; @@ -1586,7 +1587,7 @@ begin Exit; end; - CurrentCRC := $FFFFFFFF; + CurrentCRC := 0; SizeDone := 0; PrivateCancel := False; if ParamBool1 then begin @@ -1624,7 +1625,7 @@ begin end; if not (Cancelled or PrivateCancel) then if HasFinalCRC then begin - if not CurrentCRC = ParamLongWord1 + if CurrentCRC = ParamLongWord1 then ShowMessageBox(Format(LANGMergeOfSSucceeded, [StrToUTF8(ExtractFileName(TargetFinalName))]), [mbOK], mbInfo, mbNone, mbOK) else ShowMessageBox(LANGWarningCreatedFileFailsCRCCheck, [mbOK], mbWarning, mbNone, mbOK); end else ShowMessageBox(Format(LANGMergeOfSSucceeded_NoCRCFileAvailable, [StrToUTF8(ExtractFileName(TargetFinalName))]), [mbOK], mbInfo, mbNone, mbOK); @@ -1767,7 +1768,7 @@ begin end; FileSize := Stat^.Size; SizeDone := 0; - FileCRC := $FFFFFFFF; + FileCRC := 0; List := TList.Create; try @@ -1877,7 +1878,7 @@ begin TDF := Engine.GetFileSystemFree(FilePath); if (TDF < 512) and (not NewDiskQuestion) then Break; until (TDF >= 512) or PrivateCancel or Cancelled; - if WriteCRCFile(Engine, IncludeTrailingPathDelimiter(FilePath) + FileName, OriginalFName, SizeDone, not FileCRC) + if WriteCRCFile(Engine, IncludeTrailingPathDelimiter(FilePath) + FileName, OriginalFName, SizeDone, FileCRC) then ShowMessageBox(Format(LANGSplitOfSSucceeded, [StrToUTF8(OriginalFName)]), [mbOK], mbInfo, mbNone, mbOK) else begin FCancelMessage := Format(LANGSplitOfSFailed, [StrToUTF8(OriginalFName)]); |
