Back to index

glibc  2.9
Defines | Functions
putenv.c File Reference

Go to the source code of this file.

Defines

#define strchr   index

Functions

char * alloca ()
int putenv (char *string)

Define Documentation

#define strchr   index

Definition at line 35 of file putenv.c.


Function Documentation

char* alloca ( )
int putenv ( char *  string)

Definition at line 53 of file putenv.c.

{
  const char *const name_end = strchr (string, '=');

  if (name_end != NULL)
    {
#ifdef _LIBC
      char *name = strndupa (string, name_end - string);
#else
      char *name = alloca (name_end - string + 1);
      memcpy (name, string, name_end - string);
      name[name_end - string] = '\0';
#endif
      return __add_to_environ (name, NULL, string, 1);
    }

  __unsetenv (string);
  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function: