octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #53922] setenv/unsetenv are case sensitive on


From: Rik
Subject: [Octave-bug-tracker] [bug #53922] setenv/unsetenv are case sensitive on Windows while getenv is case insensitive
Date: Fri, 29 Jun 2018 19:01:47 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #13, bug #53922 (project octave):

putenv is described in Gnulib here:
https://www.gnu.org/software/gnulib/manual/html_node/putenv.html#index-putenv.

If you then follow the link for the documentation of how putenv should behave
you get to
http://pubs.opengroup.org/onlinepubs/9699919799/functions/putenv.html.

In that documentation there is this line


The setenv() function is preferred over this function. One reason is that
putenv() is optional and therefore less portable. Another is that using
putenv() can slow down environment searches, as explained in the RATIONALE
section for getenv


So maybe we shouldn't be switching over to putenv?

In any case, this is more complicated that I thought.  setenv/unsetenv only
work within the context of Octave.  If you use


system ('get varname')


then you find that the variable still persists in the Windows/bash environment
after unsetenv.  Using


setenv ('varname', '')


merely sets the variable to be empty, but it continues to exist.

This is not the way it behaves on Linux where the variable is truly removed
from the environment.



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53922>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]