Lazarus OpenDocument broken with FPC 3.2.0 + trunk for macOS lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- trev · 2021-03-28 04:39 As a result of the odd decision by the FPC developers to stop treating UNIX directories as files -- unless its the renamefile() function -- the following Lazarus code in lazarus- src/lcl/include/sysenvapis_mac.inc is broken: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i // Open a document with the default application associated with it in the systemfunction OpenDocument(APath: String): Boolean;var  ResultingPath: string;  lpath: string;begin  Result := True;  if not FileExistsUTF8(APath) then begin    // Windows OpenDocument handles URLs as well    Result := OpenURL(Apath);    Exit;  end;  // Paths with spaces need to be quoted, see bug 21651  if (APath<>'') and (APath[1]<>'''') then    ResultingPath:=QuotedStr(APath)  else    ResultingPath:=APath;  RunCmdFromPath('open',ResultingPath); The highlighted line now needs to be changed to: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if not FileExistsUTF8(APath) and not DirectoryExistsUTF8(aPath) then begin I lost many hours yesterday trying to work out why my carefully constructed Apple Help Book, a fragile construction at the best of times given Apple's outdated and now often incorrect documentation which petered out in 2013, did not work. For once, it wasn't my code and it wasn't my finely crafted property lists at fault. Logged: https://bugs.freepascal.org/view.php?id=38670 ---------------------------------------------------------------------- Bart · 2021-03-28 12:45 Please file a bugreport. Bart ---------------------------------------------------------------------- trev · 2021-03-29 09:15 I did - see last line of my post ---------------------------------------------------------------------- Bart · 2021-03-29 09:28 Thank you, I missed that. Could you upload a patch (in the bugtracker) against trunk please. See my comments in the bugreport. I don't have access to a Mac, so I cannot even check if it compiles if I make the changes myself. I'll apply it then. Bart ---------------------------------------------------------------------- trev · 2021-03-29 10:31 Working on it... done and thanks! ---------------------------------------------------------------------- Bart · 2021-03-29 15:48 Applied in r64890. Please test and close the bugreport if OK. Bart ---------------------------------------------------------------------- trev · 2021-03-29 23:54 Done and tested. Harmony has now been restored to the macOS universe in Lazarus trunk. Thanks!