소스 검색

Merge branch 'main' into x64compatible

Martijn Laan 1 년 전
부모
커밋
2e441b6d8c
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      Projects/Src/Compile.pas

+ 4 - 2
Projects/Src/Compile.pas

@@ -3243,6 +3243,7 @@ begin
   end;
   end;
 end;
 end;
 
 
+{ Note: result Value may include leading/trailing whitespaces if it was quoted! }
 procedure TSetupCompiler.SeparateDirective(const Line: PChar;
 procedure TSetupCompiler.SeparateDirective(const Line: PChar;
   var Key, Value: String);
   var Key, Value: String);
 var
 var
@@ -3264,7 +3265,7 @@ begin
     { If Value is surrounded in quotes, remove them. Note that unlike parameter
     { If Value is surrounded in quotes, remove them. Note that unlike parameter
       values, for backward compatibility we don't require embedded quotes to be
       values, for backward compatibility we don't require embedded quotes to be
       doubled, nor do we require surrounding quotes when there's a quote in
       doubled, nor do we require surrounding quotes when there's a quote in
-      the middle of the value. }
+      the middle of the value. Does *not* remove whitespace after removing quotes! }
     if (Length(Value) >= 2) and
     if (Length(Value) >= 2) and
        (Value[1] = '"') and (Value[Length(Value)] = '"') then
        (Value[1] = '"') and (Value[Length(Value)] = '"') then
       Value := Copy(Value, 2, Length(Value)-2);
       Value := Copy(Value, 2, Length(Value)-2);
@@ -3621,7 +3622,7 @@ begin
         end;
         end;
       end;
       end;
     ssCompression: begin
     ssCompression: begin
-        Value := LowerCase(Value);
+        Value := LowerCase(Trim(Value));
         if Value = 'none' then begin
         if Value = 'none' then begin
           CompressMethod := cmStored;
           CompressMethod := cmStored;
           CompressLevel := 0;
           CompressLevel := 0;
@@ -3798,6 +3799,7 @@ begin
         InfoAfterFile := Value;
         InfoAfterFile := Value;
       end;
       end;
     ssInternalCompressLevel: begin
     ssInternalCompressLevel: begin
+        Value := Trim(Value);
         if (Value = '0') or (CompareText(Value, 'none') = 0) then
         if (Value = '0') or (CompareText(Value, 'none') = 0) then
           InternalCompressLevel := 0
           InternalCompressLevel := 0
         else if not LZMAGetLevel(Value, InternalCompressLevel) then
         else if not LZMAGetLevel(Value, InternalCompressLevel) then