mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 20:40:56 +02:00
Patch from bug #21651, automatically adds quotes to paths with spaces for OpenDocument in Mac OS X
git-svn-id: trunk@37286 -
This commit is contained in:
parent
ca3cbe03f4
commit
e7dd80db45
@ -19,7 +19,15 @@ end;
|
||||
|
||||
// Open a document with the default application associated with it in the system
|
||||
function OpenDocument(APath: String): Boolean;
|
||||
var
|
||||
ResultingPath: string;
|
||||
begin
|
||||
Result := True;
|
||||
RunCmdFromPath('open',APath);
|
||||
if not FileExistsUTF8(APath) then exit(false);
|
||||
// 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);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user