delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/07/18/15:11:34

From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
Message-Id: <200107181911.VAA27882@father.ludd.luth.se>
Subject: Re: DJDIR Windows 2000 investigation results #1
In-Reply-To: <000f01c10bfc$a0b5fcf0$0a02a8c0@acceleron> from Andrew Cottrell at "Jul 14, 2001 10:33:38 am"
To: djgpp-workers AT delorie DOT com
Date: Wed, 18 Jul 2001 21:11:22 +0200 (MET DST)
X-Mailer: ELM [version 2.4ME+ PL54 (25)]
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Can somebody with W2k try this patch? It supposed to correct the
opening of files.


Right,

						MartinS
Index: src/libc/dos/io/_creat.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/dos/io/_creat.c,v
retrieving revision 1.5
diff -p -u -r1.5 _creat.c
--- src/libc/dos/io/_creat.c	2001/01/30 19:53:25	1.5
+++ src/libc/dos/io/_creat.c	2001/07/18 19:05:09
@@ -29,11 +29,14 @@ _creat(const char* filename, int attrib)
 
   if(use_lfn) {
     r.x.ax = 0x716c;
-    r.x.bx = 0x1002;		/* Open r/w with extended size. */
+    r.x.bx = 0x0002;		/* Open r/w. */
+    if (7 <= _osmajor && _osmajor < 10) {
+      r.x.bx |= 0x1000; /* 0x1000 is FAT32 extended size. */
+    }
     r.x.dx = 0x0012;		/* Create, truncate if exists */
     r.x.si = __tb_offset;
   } else {
-    if(7 <= _osmajor && _osmajor < 10) {
+    if (7 <= _osmajor && _osmajor < 10) {
       r.x.ax = 0x6c00;
       r.x.bx = 0x1002;           /* Open r/w with FAT32 extended size. */
       /* FAT32 extended size flag doesn't help on WINDOZE 4.1 (98). It
Index: src/libc/dos/io/_open.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/dos/io/_open.c,v
retrieving revision 1.4
diff -p -u -r1.4 _open.c
--- src/libc/dos/io/_open.c	2001/01/30 19:53:25	1.4
+++ src/libc/dos/io/_open.c	2001/07/18 19:05:09
@@ -30,11 +30,14 @@ _open(const char* filename, int oflag)
 
   if(use_lfn) {
     r.x.ax = 0x716c;
-    r.x.bx = (oflag & 0xff) | 0x1000; /* 0x1000 is FAT32 extended size. */
+    r.x.bx = (oflag & 0xff);
+    if (7 <= _osmajor && _osmajor < 10) {
+      r.x.bx |= 0x1000; /* 0x1000 is FAT32 extended size. */
+    }
     r.x.dx = 1;			/* Open existing file */
     r.x.si = __tb_offset;
   } else {
-    if(7 <= _osmajor && _osmajor < 10) {
+    if (7 <= _osmajor && _osmajor < 10) {
       r.x.ax = 0x6c00;
       r.x.bx = (oflag & 0xff) | 0x1000; /* 0x1000 is FAT32 extended size. */
       /* FAT32 extended size flag doesn't help on WINDOZE 4.1 (98). It

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019