mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
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:
parent
f728e7771f
commit
636a969c8b
1 changed files with 13 additions and 0 deletions
|
@ -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++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue