From: "Mark E." To: djgpp-workers AT delorie DOT com Date: Fri, 8 Jun 2001 14:15:38 -0400 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: confstr v2 Message-ID: <3B20DE0A.11643.87EA3@localhost> In-reply-to: <2110-Thu07Jun2001214706+0300-eliz@is.elta.co.il> References: <3B1F7174 DOT 21905 DOT 7E6DAE AT localhost> (snowball3 AT bigfoot DOT com) X-mailer: Pegasus Mail for Win32 (v3.12c) Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > However, if I'm the only one who thinks we should do that, perhaps it > isn't worth the hassle, and we can go with the simpler implementation > you suggested. I still believe it's overkill, but I don't think it's important enough to haggle over. I take it this is what you're after? Index: crt1.c =================================================================== RCS file: /cvs/djgpp/djgpp/src/libc/crt0/crt1.c,v retrieving revision 1.6 diff -c -p -r1.6 crt1.c *** crt1.c 2001/06/08 10:19:28 1.6 --- crt1.c 2001/06/08 18:11:06 *************** int _crt0_startup_flags; /* default to z *** 38,43 **** --- 38,45 ---- int __crt0_argc; char **__crt0_argv; + char *__crt0_djdir; + /* Local variables */ static void *************** setup_os_version(void) *** 195,200 **** --- 197,215 ---- _osminor = v & 0xff; } + static void + setup_djdir(void) + { + char *djdir; + + __crt0_djdir = getenv("DJDIR"); + if (__crt0_djdir && (djdir = malloc(strlen(__crt0_djdir) + 1))) + { + strcpy(djdir, __crt0_djdir); + __crt0_djdir = djdir; + } + } + void __crt1_startup(void) *************** __crt1_startup(void) *** 218,223 **** --- 233,239 ---- __crt0_setup_arguments(); _npxsetup(__crt0_argv ? __crt0_argv[0] : __dos_argv0); _crt0_init_mcount(); + setup_djdir(); __main(); errno = 0; /* ANSI says errno should be zero at program startup */ exit(main(__crt0_argc, __crt0_argv, environ));