From 344a85802b0dff50db43a3fdb6ec98017d774b86 Mon Sep 17 00:00:00 2001 From: nico Date: Tue, 30 May 2000 17:50:46 +0000 Subject: [PATCH] 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 --- Source/NSProcessInfo.m | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Source/NSProcessInfo.m b/Source/NSProcessInfo.m index 0e2769bcb..e733748a9 100644 --- a/Source/NSProcessInfo.m +++ b/Source/NSProcessInfo.m @@ -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++;