1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../dietlibc/putenv.patch
5 # Copyright (C) 2006 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- T2-COPYRIGHT-NOTE-END ---
19 - Rene Rebe <rene@exactcode.de>
21 --- ./lib/putenv.c 19 Feb 2006 15:38:28 -0000 1.9
22 +++ ./lib/putenv.c 22 Jun 2006 14:13:24 -0000
27 +char **__origenv; /* also used by clearenv */
29 int putenv(const char *string) {
36 - static char **origenv;
37 - if (!origenv) origenv=environ;
38 + if (!__origenv) __origenv=environ;
39 if (!(tmp=strchr(string,'='))) {
46 - newenv = (char**) realloc(environ==origenv?0:environ,
47 + newenv = (char**) realloc(environ==__origenv?0:environ,
48 (envc+2)*sizeof(char*));
49 if (!newenv) return -1;
50 - if (envc && (environ==origenv)) {
51 - memcpy(newenv,origenv,envc*sizeof(char*));
52 + if (envc && (environ==__origenv)) {
53 + memcpy(newenv,__origenv,envc*sizeof(char*));
55 newenv[envc]=(char*)string;