Rename _findenv() to __findenv(), as _findenv is in the user's namespace.
This commit is contained in:
parent
39ff8227a8
commit
722c46e238
|
@ -33,7 +33,7 @@
|
|||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
/*static char *sccsid = "from: @(#)getenv.c 5.8 (Berkeley) 2/23/91";*/
|
||||
static char *rcsid = "$Id: getenv.c,v 1.3 1993/08/26 00:47:57 jtc Exp $";
|
||||
static char *rcsid = "$Id: getenv.c,v 1.4 1993/10/15 01:26:42 jtc Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@ -49,13 +49,13 @@ getenv(name)
|
|||
const char *name;
|
||||
{
|
||||
int offset;
|
||||
char *_findenv();
|
||||
char *__findenv();
|
||||
|
||||
return(_findenv(name, &offset));
|
||||
return(__findenv(name, &offset));
|
||||
}
|
||||
|
||||
/*
|
||||
* _findenv --
|
||||
* __findenv --
|
||||
* Returns pointer to value associated with name, if any, else NULL.
|
||||
* Sets offset to be the offset of the name/value combination in the
|
||||
* environmental array, for use by setenv(3) and unsetenv(3).
|
||||
|
@ -64,7 +64,7 @@ getenv(name)
|
|||
* This routine *should* be a static; don't use it.
|
||||
*/
|
||||
char *
|
||||
_findenv(name, offset)
|
||||
__findenv(name, offset)
|
||||
register char *name;
|
||||
int *offset;
|
||||
{
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
/*static char *sccsid = "from: @(#)setenv.c 5.6 (Berkeley) 6/4/91";*/
|
||||
static char *rcsid = "$Id: setenv.c,v 1.4 1993/08/26 00:48:11 jtc Exp $";
|
||||
static char *rcsid = "$Id: setenv.c,v 1.5 1993/10/15 01:26:44 jtc Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <stddef.h>
|
||||
|
@ -54,12 +54,12 @@ setenv(name, value, rewrite)
|
|||
static int alloced; /* if allocated space before */
|
||||
register char *C;
|
||||
int l_value, offset;
|
||||
char *_findenv();
|
||||
char *__findenv();
|
||||
|
||||
if (*value == '=') /* no `=' in value */
|
||||
++value;
|
||||
l_value = strlen(value);
|
||||
if ((C = _findenv(name, &offset))) { /* find if already exists */
|
||||
if ((C = __findenv(name, &offset))) { /* find if already exists */
|
||||
if (!rewrite)
|
||||
return (0);
|
||||
if (strlen(C) >= l_value) { /* old larger; copy over */
|
||||
|
@ -111,9 +111,9 @@ unsetenv(name)
|
|||
extern char **environ;
|
||||
register char **P;
|
||||
int offset;
|
||||
char *_findenv();
|
||||
char *__findenv();
|
||||
|
||||
while (_findenv(name, &offset)) /* if set multiple times */
|
||||
while (__findenv(name, &offset)) /* if set multiple times */
|
||||
for (P = &environ[offset];; ++P)
|
||||
if (!(*P = *(P + 1)))
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue