[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH] Pascal-RTL: GetEnv



+ Pascal-RTL: dos.GetEnv implementiert

Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
 src/modules/pas/lib/dos/dos.pas |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/modules/pas/lib/dos/dos.pas b/src/modules/pas/lib/dos/dos.pas
index 9345049..6c19309 100644
--- a/src/modules/pas/lib/dos/dos.pas
+++ b/src/modules/pas/lib/dos/dos.pas
@@ -93,6 +93,8 @@ function c_directory_read(handle: Pointer): PDirEntry; cdecl; external name 'dir
 function c_init_execute(cmd: PChar): dword; cdecl; external name 'init_execute';
 function c_waitpid(pid: integer; status: Pointer; flags: integer): integer; cdecl; external name 'waitpid';
 
+function c_getenv(const name: PChar): PChar; cdecl; external name 'getenv';
+
 function LastDelimiter(const Delimiters, S: string): Integer;
 var
     i, j: longint;
@@ -323,8 +325,12 @@ begin
 end;
 
 Function GetEnv (EnvVar: String) : String;
+var
+    res: PChar;
 begin
-    GetEnv := ''; // FIXME
+    EnvVar := EnvVar + #0;
+    res := c_getenv(@EnvVar[1]);
+    GetEnv := StrPas(res);
 end;
 
 function EnvCount: longint;
-- 
1.6.0.2