Mail Archives: djgpp-workers/2002/12/13/02:52:23
This patch makes the /dev directory work for me in most cases.
*** putpath.c_ Mon Oct 21 00:28:30 2002
--- putpath.c Fri Dec 13 01:51:48 2002
***************
*** 10,13 ****
--- 10,15 ----
#include <string.h>
#include <errno.h>
+ #include <io.h>
+ #include <dpmi.h>
static const char env_delim = '~';
*************** _put_path2(const char *path, int offset)
*** 146,151 ****
path = p;
}
! else if (p[5])
! path = p + 5;
}
--- 148,172 ----
path = p;
}
! else /* Don't recognize item after /dev, remove if no directory */
! {
! __dpmi_regs r;
! const long *q;
!
! q = (const long *)path;
! _farnspokel(o, *q); /* First 8 characters */
! _farnspokel(o+4, *(q+1));
! if (path[4] == '/')
! _farnspokeb(o+4, 0); /* /dev */
! else
! _farnspokeb(o+6, 0); /* d:/dev */
!
! r.x.ax = 0x4300;
! r.x.dx = __tb_offset;
! r.x.ds = __tb_segment;
! __dpmi_int(0x21, &r);
! if ((r.x.flags & 1) || !(r.x.cx & 0x10) ) /* Exist? Directory? */
! if (p[5])
! path = p + 5;
! }
}
- Raw text -