Mail Archives: djgpp-workers/2001/06/08/14:15:36
> 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));
- Raw text -