delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/01/08/23:18:53

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <10201090418.AA14643@clio.rice.edu>
Subject: Proposed lstat.c patch for Win2000/XP device bit fix
To: djgpp-workers AT delorie DOT com
Date: Tue, 8 Jan 2002 22:18:46 -0600 (CST)
Cc: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii),
tim DOT van DOT holder AT pandora DOT be (Tim Van Holder)
In-Reply-To: <10201081508.AA23429@clio.rice.edu> from "Charles Sandmann" at Jan 08, 2002 09:08:20 AM
X-Mailer: ELM [version 2.5 PL2]
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

Seems to work in quick testing:

*** lstat.c_	Tue Dec 11 21:28:06 2001
--- lstat.c	Tue Jan  8 22:09:36 2002
*************** stat_assist(const char *path, struct sta
*** 600,605 ****
--- 600,614 ----
        if ( !(ff_blk.ff_attrib & 0x07) )  /* no R, H or S bits set */
          statbuf->st_mode |= WRITE_ACCESS;
  
+       /* Windows 2000 and XP - devices don't set attributes correctly */
+       if( (_djstat_fail_bits & _STFAIL_TRUENAME) && !ff_blk.ff_fsize &&
+           !ff_blk.ff_ftime && (ff_blk.ff_fdate == 33) && 
+           !ff_blk.lfn_ctime && (ff_blk.lfn_cdate == 33) && 
+           !ff_blk.lfn_atime && (ff_blk.lfn_adate == 33) && 
+           !strcmp(ff_blk.lfn_magic,"LFN32") &&
+           /* strlen(ff_blk.ff_name) == 3 && */ ff_blk.ff_attrib == 0x20)
+         ff_blk.ff_attrib = 0x40;  
+ 
        /* Sometimes `_truename' doesn't return X:/FOO for character
  	 devices.  However, FindFirst returns attribute 40h for them.  */
        if (ff_blk.ff_attrib == 0x40)

- Raw text -


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