浏览代码

* Fixed bug #0011528,
* StripQuotes now also does single quotes.
* Note that for TMemIniFile the previous behaviour (StripQuotes=False) is kept, which
is Delphi compatible.

git-svn-id: trunk@11674 -

michael 17 年之前
父节点
当前提交
b0d803c0a8
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      packages/fcl-base/src/inifiles.pp

+ 3 - 1
packages/fcl-base/src/inifiles.pp

@@ -620,6 +620,8 @@ constructor TIniFile.Create(const AFileName: string; AEscapeLineFeeds : Boolean
 var
   slLines: TStringList;
 begin
+  If Not (self is TMemIniFile) then
+    StripQuotes:=True;
   inherited Create(AFileName,AEscapeLineFeeds);
   FStream := nil;
   slLines := TStringList.Create;
@@ -730,7 +732,7 @@ begin
                // Joost, 2-jan-2007: The check (J>1) is there for the case that
                // the value consist of a single double-quote character. (see
                // mantis bug 6555)
-               If (J>1) and (sValue[1]='"') and (sValue[J]='"') then
+               If (J>1) and ((sValue[1] in ['"','''']) and (sValue[J]=sValue[1])) then
                  sValue:=Copy(sValue,2,J-2);
                end;  
            end;