21 #if !defined(HAVE_PUTENV) && !defined(HAVE_SETENV) 22 extern char **environ;
35 #if defined(HAVE_PUTENV) 36 sprintf(buf,
"%s=%s", name, value);
38 #elif defined(HAVE_SETENV) 39 setenv(name, value, 1);
47 for (i = 0; environ[i]; i++) ;
48 newenv = (
char **)
G_malloc((i + 1) *
sizeof(
char *));
49 for (i = 0; env = environ[i], env; i++)
56 for (i = 0; env = environ[i], env; i++) {
59 if (sscanf(env,
"%[^=]=%1s", buf, temp) < 1)
62 if (strcmp(buf, name) != 0)
66 sprintf(buf,
"%s=%s", name, value);
71 environ = (
char **)
G_realloc(environ, (i + 2) *
sizeof(
char *));
72 sprintf(buf,
"%s=%s", name, value);
void G_free(void *)
Free allocated memory.
void G_putenv(const char *name, const char *value)
Sets the UNIX environment variable name to value.
char * G_store(const char *)
Copy string to allocated memory.