Mail Archives: djgpp/1994/01/07/22:15:20
Apart from one small buglet, execv etc. works well. The bug is that
the initialization of rd in line 5 below was omitted, leading to
segfaults... (but it is *so* much nicer to be using a real compiler on
DOS -- where you *get* segfaults*, rather than random memory
corruption from (particularly Microsoft) commercial DOS compilers.
Now I just have to get file locking to work on Novell.
Thanks ../Dave
------------- libsrc/c/lib/exec.c --------------------
int spawnve(int mode, const char *path, const char **argv, const char **envp)
{
/* This is the one that does the work! */
int i = -1;
char rpath[80], *rp, *rd=0;
for (rp=rpath; *path; *rp++ = *path++)
{
if (*path == '.')
rd = rp;
if (*path == '\\' || *path == '/')
rd = 0;
}
*rp = 0;
if (rd)
{
for (i=0; interpreters[i].extension; i++)
if (stricmp(rd, interpreters[i].extension) == 0)
break;
}
- Raw text -