Sign in Join

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

Mailing lists / lazarus / 2012-04

OpenDocument on Unix: single quotes versus double quotes?

2 messages · 1 person · –

Reply by email Subscribe to this list Your subscription

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

Reinier Olislagers
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

Reply by email

Reinier Olislagers
to Reinier Olislagers
Reinier Olislagers wrote 15 lines
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

Reply by email