diff options
author | Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> | 2022-07-24 20:41:20 +0900 |
---|---|---|
committer | Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> | 2022-07-24 20:41:20 +0900 |
commit | ac6257f1507af144f7c88d030bbf076790d86a42 (patch) | |
tree | 12067be217834bca5ed0e6328d14f331a13579cf | |
parent | 13c6b648385b550efde5bf7be4bdb97cb67dec5f (diff) | |
download | zsh-ac6257f1507af144f7c88d030bbf076790d86a42.tar.gz zsh-ac6257f1507af144f7c88d030bbf076790d86a42.tar.xz zsh-ac6257f1507af144f7c88d030bbf076790d86a42.zip |
50418: use setenv(3)/getenv(3) on newer macOS
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Src/zsh_system.h | 3 | ||||
-rw-r--r-- | configure.ac | 8 |
3 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index d6d3f98d2..ce2ec2dd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2022-07-24 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> + + * 50418: Src/zsh_system.h, configure.ac: use setenv(3)/getenv(3) + on newer macOS + 2022-07-16 Bart Schaefer <schaefer@Macadamia> * users/27852: Completion/Unix/Command/_python: Make a local copy diff --git a/Src/zsh_system.h b/Src/zsh_system.h index 6f4efce96..16f724401 100644 --- a/Src/zsh_system.h +++ b/Src/zsh_system.h @@ -783,7 +783,8 @@ extern char **environ; * We always need setenv and unsetenv in pairs, because * we don't know how to do memory management on the values set. */ -#if defined(HAVE_SETENV) && defined(HAVE_UNSETENV) && !defined(__APPLE__) +#if defined(HAVE_SETENV) && defined(HAVE_UNSETENV) \ + && !defined(SETENV_MANGLES_EQUAL) # define USE_SET_UNSET_ENV #endif diff --git a/configure.ac b/configure.ac index 77e381f50..890ef8dd2 100644 --- a/configure.ac +++ b/configure.ac @@ -1515,6 +1515,14 @@ else zsh_cv_use_xattr=no fi]) +dnl We don't want to use setenv(3) on El Capitan or older OS X because it +dnl removes a leading '=' from the value of the environment variable +AH_TEMPLATE([SETENV_MANGLES_EQUAL], +[Define to 1 if setenv removes a leading =]) +case $host_os in + darwin1[0-5]*) AC_DEFINE(SETENV_MANGLES_EQUAL) ;; +esac + dnl ------------- dnl CHECK SIGNALS dnl ------------- |