FreeBSD/sys/kern/kern_environment.c
/*
 * Internal functions for string lookup.
 */
Internal functions for string lookup.
Internal functions for string lookup .
static char *
_getenv_dynamic(const char *name, int *idx)
{
	char *cp;
	int len, i;
	mtx_assert(&kenv_lock, MA_OWNED);
	len = strlen(name);
	for (cp = kenvp[0], i = 0; cp != NULL; cp = kenvp[++i]) {
		if ((strncmp(cp, name, len) == 0) &&
		    (cp[len] == '=')) {
			if (idx != NULL)
				*idx = i;
			return (cp + len + 1);
		}
	}
	return (NULL);
}
static char * _getenv_dynamic ( const char * name , int * idx ) { char * cp ; int len , i ; mtx_assert ( & kenv_lock , MA_OWNED ) ; len = strlen ( name ) ; for ( cp = kenvp [ 0 ] , i = 0 ; cp != NULL ; cp = kenvp [ ++ i ] ) { if ( ( strncmp ( cp , name , len ) == 0 ) && ( cp [ len ] == ' ' ) ) { if ( idx != NULL ) * idx = i ; return ( cp + len + 1 ) ; } } return ( NULL ) ; }
Internal functions for string lookup.
Internal functions for string lookup .