[fpc-devel]GetEnvironmentVariable problem

Sergey Korshunoff seyko at comail.ru
Tue Jun 11 08:07:08 CEST 2002


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




More information about the fpc-devel mailing list