2
0
Эх сурвалжийг харах

Merge branch 'main' into x64compatible

Martijn Laan 1 жил өмнө
parent
commit
2e441b6d8c

+ 4 - 2
Projects/Src/Compile.pas

@@ -3243,6 +3243,7 @@ begin
   end;
 end;
 
+{ Note: result Value may include leading/trailing whitespaces if it was quoted! }
 procedure TSetupCompiler.SeparateDirective(const Line: PChar;
   var Key, Value: String);
 var
@@ -3264,7 +3265,7 @@ begin
     { If Value is surrounded in quotes, remove them. Note that unlike parameter
       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
-      the middle of the value. }
+      the middle of the value. Does *not* remove whitespace after removing quotes! }
     if (Length(Value) >= 2) and
        (Value[1] = '"') and (Value[Length(Value)] = '"') then
       Value := Copy(Value, 2, Length(Value)-2);
@@ -3621,7 +3622,7 @@ begin
         end;
       end;
     ssCompression: begin
-        Value := LowerCase(Value);
+        Value := LowerCase(Trim(Value));
         if Value = 'none' then begin
           CompressMethod := cmStored;
           CompressLevel := 0;
@@ -3798,6 +3799,7 @@ begin
         InfoAfterFile := Value;
       end;
     ssInternalCompressLevel: begin
+        Value := Trim(Value);
         if (Value = '0') or (CompareText(Value, 'none') = 0) then
           InternalCompressLevel := 0
         else if not LZMAGetLevel(Value, InternalCompressLevel) then