From: sandmann AT clio DOT rice DOT edu (Charles Sandmann) Message-Id: <10212130754.AA20902@clio.rice.edu> Subject: proposed putpath.c patch To: djgpp-workers AT delorie DOT com (DJGPP developers) Date: Fri, 13 Dec 2002 01:54:23 -0600 (CST) X-Mailer: ELM [version 2.5 PL2] Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com 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 #include + #include + #include 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; ! } }