Samuel Liddicott wrote 19 lines
----- Original Message -----
From:
To: "FPC development mailing list"
Sent: Thursday, May 23, 2002 6:00 PM
Subject: Re: [fpc-devel]Stupid implementation of execlp
> With reason: Pascal Strings can only contain 255 chars. Anything outside
that
> range cannot be processed. Since the getenv only returns 255 chars, only
> that portion of the path is processed.
>
> We can fix this, but that will be for the 1.1 branch of FPC.
Accepting your answer, but for discussions sake; TP7 also had pchar support,
I wondered what the reason was for there not being a pchar version of getenv
that exelp might use.
Just curious.
Sheer laziness:
Procedure Execvp(Path:Pathstr;Args:ppchar;Ep:ppchar);
{
This does the same as Execve, only it searches the PATH environment
for the place of the Executable, except when Path starts with a slash.
if the PATH environment variable is unavailable, the path is set to '.'
}
var
thepath : string; // <<<---- max 255 chars...
begin
if path[1]'/' then
begin
Thepath:=strpas(getenv('PATH'));
if thepath='' then
etc etc etc.
I'll change it so it scans the pchar for parts of the path.
Michael.