Sign in Join

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

Mailing lists / fpc-pascal / 2017-02

GetEnv and large strings.

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

duilio foschi

I am using
Free Pascal Compiler version 2.6.2-8 [2014/01/22] for x86_64 Copyright (c) 1993-2012 by Florian Klaempfl and others Target OS: Linux for x86-64

I created a few CGIs and discovered that

function GetEnv(envvar: string):string;
in unit Dos

returns up to 256bytes (only).

I need GetEnv to return much bigger strings (up to 1K bytes).

I found
function fpGetEnv(name:pchar):pchar;
in unit BaseUnix and it works ok.

However the compiler says 'Warning: Symbol "FpGetEnv" is deprecated'.

Which is the kosher function GetEnv that wont truncate large strings ?

Thank you

DF