[Lazarus] OpenDocument on Unix: single quotes versus double quotes?

Reinier Olislagers reinierolislagers at gmail.com
Sat Apr 7 11:18:41 CEST 2012


On 6-4-2012 15:34, Reinier Olislagers wrote:
> Looking at the lclintf.OpenDocument function on Unix:
>   if (APath<>'') and (APath[1]<>'"') then
>     APath:=QuotedStr(APath);
> 
> Am I being dense again or is this an error in the code?
> The first character of APath is checked for " (double quote).
> if it isn't, the path is enclosed in single quotes.
> 
> So a path that already is included in single quotes e.g.
> '/var/lib/some unlikely location/bla.txt'
> turns into
> '''/var/lib/some unlikely location/bla.txt'''
> (if I understand
> http://www.freepascal.org/docs-html/rtl/sysutils/quotedstr.html
> correctly).

Mmmm... no responses.

Have created a patch for OSX that assumes this:

> Is this intended behaviour or should the code read like this:
>   if (APath<>'') and (APath[1]<>'''') then
>     APath:=QuotedStr(APath);

is correct behaviour - see bugtracker.

I'll leave Unix alone...

Thanks,
Reinier




More information about the Lazarus mailing list