Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2002-06

GetEnvironmentVariable problem

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Sergey Korshunoff

Hi!
Try to execute

	GetEnvironmentVariable('NON_EXISTING_ONE');

I got a SIGSEGV....

Suggestion to resolve a problem:
replace a current impementation of StrPas in objpas/syspch.inc with a one like in Kylix

StrPas(Str: PChar): ShortString;
begin
  Result:=Str;
end;

Current implementation do not check result of GetEnv (it can be a nil), and StrLen can not handle nil args too.

Regards,
Sergey Korshunoff

Reply by email