envlist_unsetenv(envlist_t *envlist, const char *env)

{

	struct envlist_entry *entry;

	size_t envname_len;



	if ((envlist == NULL) || (env == NULL))

		return (EINVAL);



	/* env is not allowed to contain '=' */

	if (strchr(env, '=') != NULL)

		return (EINVAL);



	/*

	 * Find out the requested entry and remove

	 * it from the list.

	 */

	envname_len = strlen(env);

	for (entry = envlist->el_entries.lh_first; entry != NULL;

	    entry = entry->ev_link.le_next) {

		if (strncmp(entry->ev_var, env, envname_len) == 0)

			break;

	}

	if (entry != NULL) {

		QLIST_REMOVE(entry, ev_link);

		free((char *)entry->ev_var);

		free(entry);



		envlist->el_count--;

	}

	return (0);

}

envlist_unsetenv(envlist_t *envlist, const char *env)

{

	struct envlist_entry *entry;

	size_t envname_len;



	if ((envlist == NULL) || (env == NULL))

		return (EINVAL);



	

	if (strchr(env, '=') != NULL)

		return (EINVAL);



	







	envname_len = strlen(env);

	for (entry = envlist->el_entries.lh_first; entry != NULL;

	    entry = entry->ev_link.le_next) {

		if (strncmp(entry->ev_var, env, envname_len) == 0)

			break;

	}

	if (entry != NULL) {

		QLIST_REMOVE(entry, ev_link);

		free((char *)entry->ev_var);

		free(entry);



		envlist->el_count--;

	}

	return (0);

}

		free((char *)entry->ev_var); 		free(entry); 		free((char *)entry->ev_var); 		free(entry); 		free(entry); 		free((char *)entry->ev_var); 		free(entry);
FUNC_0(envlist_t *VAR_0, const char *VAR_1)

{

	struct envlist_entry *VAR_2;

	size_t envname_len;



	if ((VAR_0 == NULL) || (VAR_1 == NULL))

		return (EINVAL);



	

	if (strchr(VAR_1, '=') != NULL)

		return (EINVAL);



	







	envname_len = strlen(VAR_1);

	for (VAR_2 = VAR_0->el_entries.lh_first; VAR_2 != NULL;

	    VAR_2 = VAR_2->ev_link.le_next) {

		if (strncmp(VAR_2->ev_var, VAR_1, envname_len) == 0)

			break;

	}

	if (VAR_2 != NULL) {

		QLIST_REMOVE(VAR_2, ev_link);

		free((char *)VAR_2->ev_var);

		free(VAR_2);



		VAR_0->el_count--;

	}

	return (0);

}

FUNC_0(envlist_t *VAR_0, const char *VAR_1)
{ struct envlist_entry *VAR_2; size_t envname_len; if ((VAR_0 == NULL) || (VAR_1 == NULL))
return (EINVAL); if (strchr(VAR_1, '=') != NULL)
return (EINVAL); envname_len = strlen(VAR_1); for (VAR_2 = VAR_0->el_entries.lh_first; VAR_2 != NULL; VAR_2 = VAR_2->ev_link.le_next) { if (strncmp(VAR_2->ev_var, VAR_1, envname_len) == 0)
break; } if (VAR_2 != NULL) { QLIST_REMOVE(VAR_2, ev_link); free((char *)VAR_2->ev_var); free(VAR_2); VAR_0->el_count--; } return (0); }