]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: drop macro and code for CYGWIN_VERSION_DLL_MALLOC_ENV
authorCorinna Vinschen <corinna@vinschen.de>
Wed, 3 Aug 2022 13:35:07 +0000 (15:35 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 3 Aug 2022 13:35:34 +0000 (15:35 +0200)
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/environ.cc
winsup/cygwin/include/cygwin/version.h

index 0ac1acc41db409c104d8e787ce0a52588da69bf0..008854a0712d7eb32228a86dc6f28b176e3a8b45 100644 (file)
@@ -291,10 +291,6 @@ env_path_to_win32 (const void *posix, void *win32, size_t size)
                           win32, size);
 }
 
-#define ENVMALLOC \
-  (CYGWIN_VERSION_DLL_MAKE_COMBINED (user_data->api_major, user_data->api_minor) \
-         <= CYGWIN_VERSION_DLL_MALLOC_ENV)
-
 #define NL(x) x, (sizeof (x) - 1)
 /* List of names which are converted from dos to unix
    on the way in and back again on the way out.
@@ -631,7 +627,7 @@ _addenv (const char *name, const char *value, int overwrite)
   char *envhere;
   if (!issetenv)
     /* Not setenv. Just overwrite existing. */
-    envhere = environ[offset] = (char *) (ENVMALLOC ? strdup (name) : name);
+    envhere = environ[offset] = (char *) name;
   else
     {                          /* setenv */
       /* Look for an '=' in the name and ignore anything after that if found. */
@@ -817,13 +813,6 @@ environ_init (char **envp, int envc)
          /* Older applications relied on the fact that cygwin malloced elements of the
             environment list.  */
          envp = newenv;
-         if (ENVMALLOC)
-           for (char **e = newenv; *e; e++)
-             {
-               char *p = *e;
-               *e = strdup (p);
-               cfree (p);
-             }
          envp_passed_in = 1;
          goto out;
        }
index d32da28562647094f7229737a99a3b47e76f7330..ae1ab83d42d5213f56ae0f9c45f71d89a3eb0f56 100644 (file)
@@ -34,8 +34,6 @@ details. */
 #define CYGWIN_VERSION_USER_API_VERSION_COMBINED \
   CYGWIN_VERSION_PER_PROCESS_API_VERSION_COMBINED (user_data)
 
-#define CYGWIN_VERSION_DLL_MALLOC_ENV          28
-
 /* Old APIs had getc/putc macros that conflict with new CR/LF handling in the
    stdio buffers */
 #define CYGWIN_VERSION_OLD_STDIO_CRLF_HANDLING \
This page took 0.036362 seconds and 5 git commands to generate.