Added log and abort when environ == NULL

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6624 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2000-05-30 17:50:46 +00:00
parent f728e7771f
commit 636a969c8b

View file

@ -269,6 +269,19 @@ static char **_gnu_noobjc_env;
#endif /* HAVE_PROGRAM_INVOCATION_NAME */
// Read environment
/* NB: This should *never* happen if your compiler tools are
sane. But, if you are playing with them, you could break
them to the point you get here. :-) */
if (environ == NULL)
{
/* TODO: Try reading environment from /proc before aborting. */
fprintf(stderr, "Error: for some reason, environ == NULL "
"during GNUstep base initialization\n"
"Please check the linking process\n");
abort();
}
c = 0;
while (environ[c] != NULL)
c++;