FreeBSD/contrib/gcc/c-incpath.c
/* Read ENV_VAR for a PATH_SEPARATOR-separated list of file names; and
   append all the names to the search path CHAIN.  */
Read ENV_VAR for a PATH_SEPARATOR-separated list of file names; and
append all the names to the search path CHAIN.
Read ENV_VAR for a PATH_SEPARATOR - separated list of file names ; and append all the names to the search path CHAIN .
static void
add_env_var_paths (const char *env_var, int chain)
{
  char *p, *q, *path;
  GET_ENVIRONMENT (q, env_var);
  if (!q)
    return;
  for (p = q; *q; p = q + 1)
    {
      q = p;
      while (*q != 0 && *q != PATH_SEPARATOR)
	q++;
      if (p == q)
	path = xstrdup (".");
      else
	{
	  path = XNEWVEC (char, q - p + 1);
	  memcpy (path, p, q - p);
	  path[q - p] = '\0';
	}
      add_path (path, chain, chain == SYSTEM, false);
    }
}
static void add_env_var_paths ( const char * env_var , int chain ) { char * p , * q , * path ; GET_ENVIRONMENT ( q , env_var ) ; if ( ! q ) return ; for ( p = q ; * q ; p = q + 1 ) { q = p ; while ( * q != 0 && * q != PATH_SEPARATOR ) q ++ ; if ( p == q ) path = xstrdup ( " " ) ; else { path = XNEWVEC ( char , q - p + 1 ) ; memcpy ( path , p , q - p ) ; path [ q - p ] = ' \0 ' ; } add_path ( path , chain , chain == SYSTEM , false ) ; } }
Read ENV_VAR for a PATH_SEPARATOR-separated list of file names; and
append all the names to the search path CHAIN.
Read ENV_VAR for a PATH_SEPARATOR - separated list of file names ; and append all the names to the search path CHAIN .