+2001-04-03 Tom Yu <tlyu@mit.edu>
+
+ * setenv.c: Add conditionals for compilation of setenv, unsetenv,
+ and getenv such that they only get compiled if they don't already
+ exist. [pullup from krb5-1-2-2-branch]
+
2000-10-17 Ezra Peisach <epeisach@mit.edu>
* krb_auth_su.c (krb5_get_tkt_via_passwd): Argument to
* Set the value of the environmental variable "name" to be
* "value". If rewrite is set, replace any current value.
*/
+#ifndef HAVE_SETENV
setenv(name, value, rewrite)
register char *name, *value;
int rewrite;
for (*C++ = '='; *C++ = *value++;);
return(0);
}
+#endif
/*
* unsetenv(name) --
* Delete environmental variable "name".
*/
+#ifndef HAVE_UNSETENV
void
unsetenv(name)
char *name;
if (!(*P = *(P + 1)))
break;
}
+#endif
/*
* Copyright (c) 1987 Regents of the University of California.
* All rights reserved.
* getenv --
* Returns ptr to value associated with name, if any, else NULL.
*/
+#ifndef HAVE_GETENV
char *
getenv(name)
char *name;
return(_findenv(name, &offset));
}
+#endif
/*
* _findenv --
* environmental array, for use by setenv(3) and unsetenv(3).
* Explicitly removes '=' in argument name.
*
- * This routine *should* be a static; don't use it.
*/
-char *
+static char *
_findenv(name, offset)
register char *name;
int *offset;