Kaynağa Gözat

Fix SetISSigAllowedKey capacity increase and cleanup SameStr call.

Martijn Laan 4 ay önce
ebeveyn
işleme
73d3d4bbc3

+ 1 - 1
Projects/Src/Compiler.SetupCompiler.pas

@@ -5015,7 +5015,7 @@ type
             SolidBreak := False;
           end;
           NewFileLocationEntryExtraInfo^.ISSigAllowedKeys := NewFileEntry^.ISSigAllowedKeys;
-        end else if not SameStr(NewFileLocationEntryExtraInfo^.ISSigAllowedKeys, NewFileEntry^.ISSigAllowedKeys) then
+        end else if NewFileLocationEntryExtraInfo^.ISSigAllowedKeys <> NewFileEntry^.ISSigAllowedKeys then
           AbortCompile(SCompilerFilesISSigAllowedKeysConflict);
         if Touch then
           Include(NewFileLocationEntryExtraInfo^.Flags, floApplyTouchDateTime);

+ 2 - 2
Projects/Src/Shared.SetupTypes.pas

@@ -315,9 +315,9 @@ end;
 procedure SetISSigAllowedKey(var ISSigAllowedKeys: AnsiString; const KeyIndex: Integer);
 begin
   { ISSigAllowedKeys should start out empty. If you then only use this function
-    to update it, SameStr can be used for comparisons. }
+    to update it, regular string comparison can be used for comparisons. }
   const ByteIndex = KeyIndex div 8;
-  if ByteIndex >= Length(ISSigAllowedKeys) then
+  while ByteIndex >= Length(ISSigAllowedKeys) do
     ISSigAllowedKeys := ISSigAllowedKeys + #0;
   const BitIndex = KeyIndex mod 8;
   ISSigAllowedKeys[ByteIndex+1] := AnsiChar(Byte(ISSigAllowedKeys[ByteIndex+1]) or (1 shl BitIndex));