-/* OPENBSD ORIGINAL: lib/libc/stdlib/setenv.c */
-
/*
* Copyright (c) 1987 Regents of the University of California.
* All rights reserved.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* SUCH DAMAGE.
*/
-#include "includes.h"
+#include "config.h"
#ifndef HAVE_SETENV
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: setenv.c,v 1.6 2003/06/02 20:18:38 millert Exp $";
+static char *rcsid = "$OpenBSD: setenv.c,v 1.3 1998/02/02 22:44:53 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdlib.h>
#include <string.h>
-char *__findenv(const char *name, int *offset);
-
/*
* __findenv --
* Returns pointer to value associated with name, if any, else NULL.
static int alloced; /* if allocated space before */
register char *C;
int l_value, offset;
+ char *__findenv();
if (*value == '=') /* no `=' in value */
++value;
if (!rewrite)
return (0);
if (strlen(C) >= l_value) { /* old larger; copy over */
- while ((*C++ = *value++))
- ;
+ while ((*C++ = *value++));
return (0);
}
} else { /* create new slot */