[fpc-devel]fpc and ppc386
Marco van de Voort
marcov at stack.nl
Thu Feb 12 20:23:31 CET 2004
> OK, I just figured out what was the cause of this problem.
>
> In SysUtils.ExecuteProcess you were wrapping ppcbin compiler filename
> (like '/usr/local/ppc386') inside quotes (to make it something like
> '"/usr/local/ppc386"') but you were not stripping those quotes anywhere
> before passing this to execve (i.e. FpExecVE). So it shouldn't work
> (since execve should not tolerate any additional quotes in filename,
> even if it does on some UNIXes).
>
> Patch to rtl/unix/unixutil.pp attached with (too many?) comments, it
> modifies StringToPPChar behavior so that it strips those quotes.
While this is a solution in theory, I think this is only "hacking" a broken
design.
I today commited fixes that keeps commandline and program to execute separately.
However that only solves the case for the program that is to be executed.
Arguments containing spaces will still go wrong. (Unix is very strict in this
regard, arguments must be separated by the application). The best solution
is to not have an interface that requires the arguments to be separated,
iow, the primary function should be of the form
function execute(programtobeexecuted:ansistring);const arg : array of ansistring):cint;
This because there are several kinds of escaping spaces. Windows traditionally uses quotes,
but unix uses escaping with backspaces.
However I will review your changes anyway, since at least they make sense for applications using the
old interfaces.
More information about the fpc-devel
mailing list