aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2016-04-30 17:46:14 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2016-04-30 17:46:14 -0700
commit58d7c4b388067771e0ce1cf0dffd376c6b7fb9f2 (patch)
tree1e6f3d780cdfe1c6f5ca35bd4b2787ce907f9682
parenta897ef002521a3991adc4342189f0e30a0d048b0 (diff)
Remove use of __environ
It has apparently never worked. Fixes #2988
-rw-r--r--configure.ac24
-rw-r--r--osx/config.h3
-rw-r--r--src/env.cpp4
-rw-r--r--src/fallback.cpp6
4 files changed, 1 insertions, 36 deletions
diff --git a/configure.ac b/configure.ac
index 87bf46b7..0236fc8a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -675,30 +675,6 @@ else
AC_MSG_RESULT(no)
fi
-# Check for __environ symbol
-AC_MSG_CHECKING([for __environ symbol])
-AC_TRY_LINK(
- [
- #include <unistd.h>
- ],
- [
- extern char **__environ;
- char **tmp = __environ;
- exit(tmp!=0);
- ],
- have___environ=yes,
- have___environ=no
-)
-if test "$have___environ" = yes; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(
- [HAVE___ENVIRON],
- [1],
- [Define to 1 if the __environ symbol is exported.]
- )
-else
- AC_MSG_RESULT(no)
-fi
# Check for sys_errlist
AC_MSG_CHECKING([for sys_errlist array])
diff --git a/osx/config.h b/osx/config.h
index 0a553016..fd61d273 100644
--- a/osx/config.h
+++ b/osx/config.h
@@ -206,9 +206,6 @@
/* Define to 1 if the _sys_errs array is available. */
/* #undef HAVE__SYS__ERRS */
-/* Define to 1 if the __environ symbol is exported. */
-/* #undef HAVE___ENVIRON */
-
/* Define to 1 to disable ncurses macros that conflict with the STL */
#define NCURSES_NOMACROS 1
diff --git a/src/env.cpp b/src/env.cpp
index 40af30bf..e4829a46 100644
--- a/src/env.cpp
+++ b/src/env.cpp
@@ -45,8 +45,6 @@
/// At init, we read all the environment variables from this array.
extern char **environ;
-/// This should be the same thing as \c environ, but it is possible only one of the two work...
-extern char **__environ;
bool g_log_forks = false;
bool g_use_posix_spawn = false; // will usually be set to true
@@ -311,7 +309,7 @@ void env_init(const struct config_paths_t *paths /* or NULL */) {
// Import environment variables. Walk backwards so that the first one out of any duplicates wins
// (#2784).
wcstring key, val;
- const char *const *envp = (environ ? environ : __environ);
+ const char *const *envp = environ;
size_t i = 0;
while (envp && envp[i]) {
i++;
diff --git a/src/fallback.cpp b/src/fallback.cpp
index e3dcfed0..b53aec74 100644
--- a/src/fallback.cpp
+++ b/src/fallback.cpp
@@ -46,12 +46,6 @@
#include "fallback.h" // IWYU pragma: keep
#include "util.h" // IWYU pragma: keep
-#ifndef HAVE___ENVIRON
-
-char **__environ = 0;
-
-#endif
-
#ifdef TPUTS_KLUDGE
int tputs(const char *str, int affcnt, int (*fish_putc)(tputs_arg_t))