delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/09/30/22:12:09

From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <10110010207.AA17544@clio.rice.edu>
Subject: mntent patch
To: eliz AT is DOT elta DOT co DOT il
Date: Sun, 30 Sep 2001 21:07:12 -0500 (CDT)
Cc: djgpp-workers AT delorie DOT com
In-Reply-To: <9003-Sun30Sep2001093244+0300-eliz@is.elta.co.il> from "Eli Zaretskii" at Sep 30, 2001 09:32:44 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

Still one constant 0x332 I don't understand, but does not seem to make a
difference in behavior so I didn't change it.

Suggested patch:

*** mntent.c_	Sun Jun 10 05:48:24 2001
--- mntent.c	Sun Sep 30 21:07:06 2001
***************
*** 45,48 ****
--- 45,51 ----
  #include <sys/movedata.h>
  #include <libc/dosio.h>
+ #include <libc/unconst.h>
+ #include <stdlib.h>
+ #include <fcntl.h>
  
  /* Macro to convert a segment and an offset to a "far offset" suitable
*************** static char          drive_number = -1;
*** 63,66 ****
--- 66,70 ----
  static char          skip_drive_b = 0;
  static char          drive_a_mapping = 0;
+ static char          w2k_bug;
  static char          cds_drives   = 0;
  static unsigned long cds_address;
*************** setmntent(const char *filename, const ch
*** 435,442 ****
    int cds_address_offset;
    /* Need TRUE DOS version. */
!   unsigned short true_dos_version = _get_dos_version(1);
  
    dos_mem_base = _go32_info_block.selector_for_linear_memory;
    our_mem_base = _my_ds();
  
    drive_number = 0;
--- 439,447 ----
    int cds_address_offset;
    /* Need TRUE DOS version. */
!   unsigned short true_dos_version = _os_trueversion;
  
    dos_mem_base = _go32_info_block.selector_for_linear_memory;
    our_mem_base = _my_ds();
+   w2k_bug = (_USE_LFN && _os_trueversion == 0x532);
  
    drive_number = 0;
*************** getmntent(FILE *filep)
*** 535,538 ****
--- 540,547 ----
          continue;
  
+       /* Windows 2000 dislikes drives higher than Z */
+       if (drive_number > cds_drives && _os_trueversion == 0x532)
+         continue;
+ 
        /* See whether drive A: is mapped to B: and if it is, raise the
  	 flag to skip drive number 2 next time we are called (meaning
*************** getmntent(FILE *filep)
*** 719,722 ****
--- 728,734 ----
            strcat(drive_string, "*.*");
            errno = 0;
+           /* Windows 2000/XP can't find labels with LFN=y, so help it */
+           if (w2k_bug)
+             putenv(unconst("LFN=n",char *));
            volume_found = findfirst(drive_string, &mnt_ff, FA_LABEL) == 0;
            /* Floppies and other disks written by Windows 9X include
*************** getmntent(FILE *filep)
*** 732,735 ****
--- 744,749 ----
  	      volume_found = findnext(&mnt_ff) == 0;
              }
+           if (w2k_bug)
+             putenv(unconst("LFN=y",char *));
  
            if (volume_found)

- Raw text -


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