[fpc-devel] TProcess empty parameter

Alfred alfred at consulab.nl
Tue May 5 12:31:09 CEST 2015


Thanks for your answer !

To be honest, I do not know exactly what to do to solve this problem.

If I look at the source of TProcess, a lot of thing are done with the 
parameters.
The parameters are parsed into a list. And again converted into a 
PCharList.
And some info is lost during these conversions.

The (unix) command involved is:
Exe='svn';
Cmd:='checkout --username "ausername" --password "" -r HEAD remoterepo 
localrepo';
ExecuteCommand(Exe+' '+Cmd,....);

As the command itself is a single string, I do not understand why all 
parameters are split and then combined again. In all conversions, the 
empty password string is lost when using ExecuteCommand from the 
processutils unit.

In my search, I came across StrPas and StrNew, and found out that they 
return nil for empty string, as opposed to Delphi. But again, I do not 
know if this has something to do with this empty string problem.

As a workaround fpcup now uses: fpSystem(Exe+' '+Command);
But I have to use some trickery to get the output from this command.
I would prefer to use ExecuteCommand on all architectures.




More information about the fpc-devel mailing list