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

Reinier Olislagers reinierolislagers at gmail.com
Fri Apr 6 15:34:23 CEST 2012


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).

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


Thanks,
Reinier




More information about the Lazarus mailing list