delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/10/11/23:02:18

From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <10110120257.AA19829@clio.rice.edu>
Subject: W2K/XP fncase [was Re: New perl package]
To: djgpp-workers AT delorie DOT com, eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Thu, 11 Oct 2001 21:57:29 -0500 (CDT)
Cc: tim DOT van DOT holder AT pandora DOT be (Tim Van Holder), acottrel AT ihug DOT com DOT au
In-Reply-To: <7263-Fri12Oct2001005023+0200-eliz@is.elta.co.il> from "Eli Zaretskii" at Oct 12, 2001 12:50:23 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

> The library functions which need to decide whether to downcase a file
> name they've got from the OS all run code similar to this:
> 
>       if (!strcmp(_lfn_gen_short_fname(long_name, short_name), long_name))
>         /* downcase the file name */
> 
> The function _lfn_gen_short_fname puts into its second argument the
> short variant of the file name in its first argument.  The short
> variant is the 8+3 alias, but without the numeric tail, i.e. as if
> NameNumericTail was set to zero.  If these two strings are identical
> (including the case!), then we decide that this is a DOS file name,
> and downcase it.  (If FNCASE is set to y, this code is bypassed, and
> all file names are returned exactly as they are recorded in the
> directory.)

Ok, this is the problem.  Modified fixpath as an example:
W95:
short: TEST long: test
short: _.CVS long: _.CVS
Fixpath: c:/test/_.cvs
W2K:
short: TEST. long: test
short: _67C0CVS. long: _.CVS
Fixpath: c:/test/_.CVS

> _lfn_gen_short_fname calls function 71A8h of Int 21h.  So either XP
> botches that function, or it returns some unexpected result that
> confuses the logic inside _lfn_gen_short_fname.  Please step with a
> debugger into that function and see what's going on there.

As you can see above, it botches 71A8h - it adds a period to the short
name; but more interesting is the short value for _.CVS - I can't even
explain that one.  Another good one:

C:\BOOT>d:\fixpath config.sys
Get dir[4]: \BOOT
short: BOOT. long: BOOT
short: CONFIGSY.S long: config.sys
Fixpath: c:/BOOT/config.sys

So, since this function is hopeless on W2K/XP, ideas?  It would be much
faster to avoid all those useless interrupts ...

- Raw text -


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