Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2008-08

Bug in GetAppConfigDir(True) on unix systems!

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Calling GetAppConfigDir(True) returns the wrong results...

In my application I expected....

/etc/<AppName>/

but instead it returned

/etc<AppName>/

Note the missing directory separator!

---------------[ rtl/unix/sysutils.pp ]-------------------

Function GetAppConfigDir(Global : Boolean) : String;
begin
  If Global then
    Result:=SysConfigDir
  else
    Result:=XdgConfigHome;
  if VendorName'' then
    Result:=IncludeTrailingPathDelimiter(Result+VendorName);   //<===
No dir separator???
  Result:=IncludeTrailingPathDelimiter(Result+ApplicationName);
//<=== No dir separator???
end;

SysConfigDir is set to '/etc' for unix systems. No trailing directory separator.
Above I indicated two places where the directory separator must be added. I'm using FPC 2.2.3 r11214.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys

GetAppConfigFile() has the same issue.

Graeme Geldenhuys wrote 14 lines
Hi, Calling GetAppConfigDir(True) returns the wrong results... In my application I expected.... /etc/<AppName>/ but instead it returned /etc<AppName>/ Note the missing directory separator!

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Joost van der Sluis
to Graeme Geldenhuys

This is fixed in fpc-trunk a few weeks ago. I'll morge it to fixes.

Joost

Op donderdag 07-08-2008 om 12:01 uur [tijdzone +0200], schreef Graeme Geldenhuys:

Show quoted text 34 lines
GetAppConfigFile() has the same issue. On Thu, Aug 7, 2008 at 11:30 AM, Graeme Geldenhuys wrote: > Hi, > > Calling GetAppConfigDir(True) returns the wrong results... > > In my application I expected.... > > /etc/<AppName>/ > > but instead it returned > > /etc<AppName>/ > > > Note the missing directory separator! Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Graeme Geldenhuys
to Joost van der Sluis
Joost van der Sluis wrote
This is fixed in fpc-trunk a few weeks ago. I'll morge it to fixes.

Umm, I knew I had to fix the tiOPF unit tests ages ago, that way I would have detected the bug much earlier. :)

I'll get another update of Fixes branch, thanks Joost!

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email