getenv.c
int env_index(const char *name)
{
	int i, ii, ni;

	for (i = 0; environ[i]; i++)
		for (ni = 0, ii = 0; name[ni] && environ[i][ii]; ni++, ii++)
		{
			if (environ[i][ii] != name[ni])
				break;
			if (environ[i][ii + 1] == '=' && !name[ni + 1])
				return (i);
		}
	return (-1);
}
/**
 * env_index - finds the index in environ global variable where name is found
 * @name: environmental variable
 * Return: index of environ where name is found, or -1 if not
 */
finds the index in environ global variable where name is found
@name: environmental variable
Return: index of environ where name is found, or -1 if not
finds the index in environ global variable where name is found @name : environmental variable Return : index of environ where name is found or - 1 if not
int env_index(const char *name)
{
	int i, ii, ni;
	for (i = 0; environ[i]; i++)
		for (ni = 0, ii = 0; name[ni] && environ[i][ii]; ni++, ii++)
		{
			if (environ[i][ii] != name[ni])
				break;
			if (environ[i][ii + 1] == '=' && !name[ni + 1])
				return (i);
		}
	return (-1);
}
int env_index ( const char * name ) { int i , ii , ni ; for ( i = 0 ; environ [ i ] ; i ++ ) for ( ni = 0 , ii = 0 ; name [ ni ] && environ [ i ] [ ii ] ; ni ++ , ii ++ ) { if ( environ [ i ] [ ii ] != name [ ni ] ) break ; if ( environ [ i ] [ ii + 1 ] == ' ' && ! name [ ni + 1 ] ) return ( i ) ; } return ( -1 ) ; }
env_index - finds the index in environ global variable where name is found
 @name: environmental variable
 Return: index of environ where name is found, or -1 if not
env_index - finds the index in environ global variable where name is found @name : environmental variable Return : index of environ where name is found or - 1 if not