View Issue Details

IDProjectCategoryView StatusLast Update
0035731FPCFCLpublic2019-06-19 08:13
ReporterMartin JülichAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.0.4Product Build 
Target VersionFixed in Version3.3.1 
Summary0035731: TIniFile.ReadSectionRaw does not return comments
DescriptionFrom documentation: "ReadSectionRaw returns the contents of the section Section as it is: this includes the comments in the section."

procedure TIniFile.ReadSectionRaw(const Section: string; Strings: TStrings);
var
  oSection: TIniFileSection;
  i: integer;
begin
  Strings.BeginUpdate;
  try
    Strings.Clear;
    oSection := FSectionList.SectionByName(Section,CaseSensitive);
    if oSection <> nil then with oSection.KeyList do
      for i := 0 to Count-1 do
        if not IsComment(Items[i].Ident) then //<<<<<<<<<<<<<< comments will NOT be included
         begin
           if Items[i].Ident<>'' then
            Strings.Add(Items[i].Ident + Separator +Items[i].Value)
           else
            Strings.Add(Items[i].Value);
         end;
  finally
    Strings.EndUpdate;
  end;
end;
TagsNo tags attached.
Fixed in Revision42247
FPCOldBugId
FPCTarget3.2.0
Attached Files

Activities

Michael Van Canneyt

2019-06-19 08:13

administrator   ~0116778

Adapted implementation to match documentation.
In general, it is better to use ReadSectionValues with associated options.

Thanks for reporting !

Issue History

Date Modified Username Field Change
2019-06-19 06:37 Martin Jülich New Issue
2019-06-19 08:12 Michael Van Canneyt Assigned To => Michael Van Canneyt
2019-06-19 08:12 Michael Van Canneyt Status new => assigned
2019-06-19 08:13 Michael Van Canneyt Status assigned => resolved
2019-06-19 08:13 Michael Van Canneyt Resolution open => fixed
2019-06-19 08:13 Michael Van Canneyt Fixed in Version => 3.3.1
2019-06-19 08:13 Michael Van Canneyt Fixed in Revision => 42247
2019-06-19 08:13 Michael Van Canneyt FPCTarget => 3.2.0
2019-06-19 08:13 Michael Van Canneyt Note Added: 0116778