[Lazarus] Opening a file with spaces in the filename (again)
Bart
bartjunk64 at gmail.com
Wed Mar 6 00:19:11 CET 2013
On 3/5/13, Bart <bartjunk64 at gmail.com> wrote:
> The original bugreport was about OpenUrl.
> And thing went sour (for 9x) when the file:// URI scheme was used and
> it was quoted, and it seemed it needed quoting on some NT based
> systems.
I patched OpenURL on Windows to quote the URL if it is in file:// URI
schem and contains spaces on NT platform.
This should fix the original issue of
http://bugs.freepascal.org/view.php?id=21659
Question remains if we should quote APath in OpenDocument?
AFAIK ShellExecute(0, nil,PChar(APath), nil, nil, SW_SHOWNORMAL) will
always eventually call something like "\path\to\exe" "%1", where the
%1 is quoted and will become "APath", otherwise no app would never be
able to open files with spaces in the name via this route.
(Meaning any sane app should register itself in such a way that quotes
are forced around the parameter)
Bart
More information about the Lazarus
mailing list