Mail Archives: djgpp-workers/2001/10/01/23:20:05
A simple change of order of operations to set the drive letter before
setting the directory seems to make the problem go away. Not fully
tested on other platforms. Seems to work just fine if I set a bogus
letter since the change directory catches it. Comments?
*** chdir.c_ Tue Aug 22 12:41:16 2000
--- chdir.c Mon Oct 1 22:11:30 2001
*************** __chdir (const char *mydirname)
*** 48,51 ****
--- 48,59 ----
drv_no = (_farpeekb(_dos_ds, __tb) & 0x1f) - 1;
+ if (drv_no != -1) /* Must do this first on Win 2K with long paths. */
+ {
+ /* Change current drive. The directory change below checks it. */
+ r.h.ah = 0x0e;
+ r.h.dl = drv_no;
+ __dpmi_int(0x21, &r);
+ }
+
if (drv_no == -1 || _farpeekb(_dos_ds, __tb + 2) != 0)
{
*************** __chdir (const char *mydirname)
*** 64,76 ****
}
- if (drv_no != -1)
- {
- /* Change current drive also. This *will* work if
- the directory change above worked. */
- r.h.ah = 0x0e;
- r.h.dl = drv_no;
- __dpmi_int(0x21, &r);
- }
-
return 0;
}
--- 72,75 ----
- Raw text -