[fpc-devel] TProcess empty parameter

Michael Van Canneyt michael at freepascal.org
Thu May 7 12:59:52 CEST 2015



On Thu, 7 May 2015, Marco van de Voort wrote:

> In our previous episode, Michael Van Canneyt said:
>
> (on rereading the whole thread)
>
>> That is only if you use the CommandLine property.
>> If you use the stringlist (Parameters), no parsing is done.
>
> The mentioned routine is the tstringlist to array of pchar conversion, and
> afaik also applies to the separated part.
>
> Since NIL is a termination of an array of pchar in C that is not ok.

if that were the case, argc would not have been introduced, 
which is why I doubt the use of this argument ?

C code that regards nil as the last element of the argv array is just wrong.

In each case, it is not relevant to the discussion.

>
> behaviour of strnew should be checked in both TP and Delphi (since both have
> strnew) and if necessary changed. (returning FPC_EMPTYCHAR or whatever)
>
> If it can't be changed, it must be worked around in process.inc.

Exactly my initial point.

>
>
> That being said, it is a very good idea for fpcup maintainers to cleanup
> legacy as much as possible, and work towards representing a commandline as
> an array of string, and not a single string.

Indeed, agreed 100%.

If the code still used commandline, then that must be changed to the new parameters.
If I recall correctly, commandline is marked deprecated so it should be easy to spot.

Michael.



More information about the fpc-devel mailing list