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:
sekelsenmat 2012-05-15 07:51:43 +00:00
parent ca3cbe03f4
commit e7dd80db45

View File

@ -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;