[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Axiom-developer] system::getenv does not return MSYS environ ment v
From: |
Page, Bill |
Subject: |
RE: [Axiom-developer] system::getenv does not return MSYS environ ment variables |
Date: |
Tue, 7 Dec 2004 18:23:01 -0500 |
Camm,
On Tuesday, December 07, 2004 5:30 PM you replied:
>
> "Page, Bill" <address@hidden> writes:
>> One of the external lib/cfunc.c routines is copyEnvValue which
>> calls the stdlib routine getenv(). A simple test program shows
>> that this gets both AXIOM and PATH variables properly. But it
>> is apparently no longer used in Axiom. I wonder what GCL is
>> calling of system::getenv?
>
> This is just a wrapper around the C library getenv. Does this
> not work on Windows? Code is in main.c.
>
Yes I see the code in main.c that implements system::getenv.
I am at a complete loss to explain following since apparently
both copyEnvValue.c in Axiom's lib/cfun-c.c *and* system::getenv
both call getenv from <stdlib>. Are there two different stdlib's??
What is observe is the following::
1) In Windows I go
Start/Control Panel/System/Advanced/Enviroment Variables
and I set an environment variable, say
W1 c:/xxx/yyy
2) Then I start an MSYS shell. I can see the environment variable
W1 from the shell
echo $W1
c:/xxx/yyy
3) Set another environment variable here in MSYS
export M1=d:/www/zzz
echo $M1
d:/www/zzz
4) Start GCL (in my case it was AXIOMsys) and interrogate
the environment variables
(system::getenv "W1")
"c:/xxx/yyy"
(system::getenv "M1")
NIL
GCL doesn't see the MSYS environment variable.
5) Write a simple C program that calls getenv directly
# test.c
#include <stdlib.h>
#include <stdio.h>
main () {
fprintf(stdout,"W1=%s\n",getenv("W1"));
fprintf(stdout,"M1=%s\n",getenv("M1"));
}
gcc test.c -o test
test
W1=c:/xxx/yyy
M1=d:/www/zzz
In this case the program sees both environment
variables.
6) Can you guess what happens if we use the same
environment variable names in both Windows and
in MSYS?
--------
Regards,
Bill Page.
RE: [Axiom-developer] system::getenv does not return MSYS environ ment variables, Page, Bill, 2004/12/08