Bill,

  A quick look at the underlying implementation shows a call to the C
library getenv() function to get the value of the environment variable. It
is interesting to see Windows case sensitive in this case where it is not
anywhere else! There is no trivial fix for this problem as we can't guess
the correct case for an environment variable, the only thing to do is do to
a brute-force search trying all possible case combinations for all letters,
even though I don't expect someone the set the path environment variable as
PaTh. In your case you can try using a wrapper function mygetenv() as
follows:

procedure mygetenv(x)
      return getenv(x) # try it as-is

      xL := map(x, &ucase, &lcase)
      return getenv(xL) # try all lower case

      xU := map(x, &lcase, &ucase)
      return getenv(xU) # try all upper case

     # try all caps at the beginning like Path, PAth PATh...
      every i:=1 to *x do
          return getenv(xU[1:i+1] || xL[i+1:0] )
end

Of course this doesn't cover all possible permutations of lower/upper case
letters in x. but it might be enough in your case, or you can extend it to
handle more cases should you need.

Cheers,
Jafar



On Fri, Jun 8, 2012 at 11:43 AM, Willard Bass <[email protected]> wrote:

> I recently installed latest binaries for Windows on Windows 7. I find that
> Environment Variables are *case-sensitive *- a problem which wreaks havoc
> with Unicon: e.g., getenv("PATH") fails because the environment variable on
> my Windows 7 machine has been set to "Path" - accordingly getenv("Path")
> succeeds.
>
> There is a lot of blather about the issue on the Net, and mention that is
> is "fixed" in .NET 4.0 - but nothing generally for Windows 7.
>
> Can anyone advise?
>
> Thanks
>
> Bill Bass
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Unicon-group mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/unicon-group
>
>


-- 
"Let there be no compulsion in religion: Truth stands out clear from error"
[The Holy Qur'an 2:256]

"Injustice anywhere is a threat to justice everywhere"    Dr. King
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to