Displaying 2 results from an estimated 2 matches for "__findenv".
2000 Mar 25
0
replacement putenv()
...en support putenv()
** So therefor we need a real setenv().
*/
int
setenv(name, value, rewrite)
register const char *name;
register const char *value;
int rewrite;
{
extern char **environ;
static int alloced; /* if allocated space before */
register char *C;
int l_value, offset;
char *__findenv();
if (*value == '=') /* no `=' in value */
++value;
l_value = strlen(value);
if ((C = __findenv(name, &offset))) { /* find if already exists */
if (!rewrite)
return (0);
if (strlen(C) >= l_value) { /* old larger; copy over */
while (*C++ = *value++);
return...
2002 Jun 27
1
OpenSSH 3.3p1 on SunOS 4.1.4
...-- cut here ------------8<-------------
*** openbsd-compat/setenv.c.orig Wed Feb 13 06:00:16 2002
--- openbsd-compat/setenv.c Wed Jun 26 18:27:17 2002
***************
*** 40,45 ****
--- 40,46 ----
#include <stdlib.h>
#include <string.h>
+ #include <memory.h>
/*
* __findenv --
***************
*** 123,129 ****
(cnt + 2)));
if (!P)
return (-1);
! memmove(P, environ, cnt * sizeof(char *));
environ = P;
}
environ[cnt + 1] = NULL;
--- 124,130 ----
(cnt + 2)));
if (!P)
return (-1);
! memcpy(P, environ, cnt * sizeof(...