xref: /netbsd/external/bsd/libbind/dist/bsd/putenv.c (revision e6e30c83)
1*e6e30c83Schristos /*	$NetBSD: putenv.c,v 1.1.1.2 2012/09/09 16:07:43 christos Exp $	*/
2b5677b36Schristos 
3b5677b36Schristos #ifndef LINT
4b5677b36Schristos static const char rcsid[] = "Id: putenv.c,v 1.2 2005/04/27 04:56:11 sra Exp ";
5b5677b36Schristos #endif
6b5677b36Schristos 
7b5677b36Schristos #include "port_before.h"
8b5677b36Schristos #include "port_after.h"
9b5677b36Schristos 
10b5677b36Schristos /*%
11b5677b36Schristos  * To give a little credit to Sun, SGI,
12b5677b36Schristos  * and many vendors in the SysV world.
13b5677b36Schristos  */
14b5677b36Schristos 
15b5677b36Schristos #if !defined(NEED_PUTENV)
16b5677b36Schristos int __bindcompat_putenv;
17b5677b36Schristos #else
18b5677b36Schristos int
putenv(char * str)19b5677b36Schristos putenv(char *str) {
20b5677b36Schristos 	char *tmp;
21b5677b36Schristos 
22b5677b36Schristos 	for (tmp = str; *tmp && (*tmp != '='); tmp++)
23b5677b36Schristos 		;
24b5677b36Schristos 
25b5677b36Schristos 	return (setenv(str, tmp, 1));
26b5677b36Schristos }
27b5677b36Schristos #endif
28b5677b36Schristos 
29b5677b36Schristos /*! \file */
30