Hello.

Clarence Dang wrote:
If you CC me comcom or joystick bug reports they will get fixed faster (as opposed to probably not at all :)) since I don't read every single email that comes up on MLs.
Hmm, how about updating the doc/DPR
then?

BTW, Stas, I'm looking into the comcom problem at sourceforge.
OK, I just wanted to finally give a
comcom a try, but it appeared to be
completely useless for me:(
At first, it simply crashes my dosemu
without the attached hack: for some
reasons the duplicate_env() is called
when ctcb->envir_frame==0, hence the
crash. Do you know why is this happens?
Then, with the hack applied, it started
to complain on using "lh" in autoexec.
That was enough of trying it for now:)
--- comcom.c.old        Sat Jan 11 05:44:58 2003
+++ comcom.c    Sun Jan 12 20:07:03 2003
@@ -3514,15 +3514,20 @@
 static int duplicate_env(int size)
 {
        struct com_starter_seg  *ctcb = CTCB;
-       struct com_MCB *mcb = (void *)((ctcb->envir_frame-1) << 4);
        char *newenv;
-       int oldsize = mcb->size << 4;
+       struct com_MCB *mcb = NULL;
+       int oldsize = 0;
 
+       if (ctcb->envir_frame) {
+           mcb = (void *)((ctcb->envir_frame-1) << 4);
+           oldsize = mcb->size << 4;
+       }
        size = (size+15) & -16;
        if (size <= oldsize) size = oldsize;
        newenv = (char *)com_dosallocmem(size);
        if ((int)newenv < 0) return oldsize;    /* giving up */
-       memcpy(newenv, ((char *)mcb)+16, oldsize);
+       if (oldsize)
+           memcpy(newenv, ((char *)mcb)+16, oldsize);
        ctcb->envir_frame = ((unsigned int)newenv) >> 4;
        return size;
 }

Reply via email to