www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/02/16/06:30:34

Date: Sun, 16 Feb 1997 13:27:46 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Robert Hoehne <robert DOT hoehne AT mathematik DOT tu-chemnitz DOT de>
cc: DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: Re: Patch for _use_lfn.c
In-Reply-To: <Pine.HPP.3.95q.970214104532.28681A-100000@newton.mathematik.tu-chemnitz.de>
Message-ID: <Pine.SUN.3.91.970216132439.15715B-100000@is>
MIME-Version: 1.0

On Fri, 14 Feb 1997, Robert Hoehne wrote:

> The patch for _use_lfn.c is to speed up _use_lfn().
> When I understood the function correct, the variable
> 'filesystem_flags' is used to avoid unneccessary calls
> to getenv(). But with the current implementation it is
> set only, when "LFN=y".

I see your point, but I suggest to fix this problem in a slightly 
different manner (which I think is both faster and safer, since it 
doesn't call `_get_volume_info' when LFN is set to N).  Can you see if 
the patch below works for you with the same efficiency as yours?

*** src/libc/dos/lfn/_use_lfn.c~0	Sun Feb 16 11:32:06 1997
--- src/libc/dos/lfn/_use_lfn.c	Sun Feb 16 11:35:48 1997
*************** _use_lfn (const char *path)
*** 153,159 ****
      lfnenv = getenv ("LFN");
      if(lfnenv && (tolower (lfnenv[0]) == 'n'))
      {
!       filesystem_flags &= ~_FILESYS_LFN_SUPPORTED;
        last_drive = 0;
        return 0;
      }
--- 153,162 ----
      lfnenv = getenv ("LFN");
      if(lfnenv && (tolower (lfnenv[0]) == 'n'))
      {
!       if (filesystem_flags == _FILESYS_UNKNOWN)
!         filesystem_flags = 0;
!       else
!         filesystem_flags &= ~_FILESYS_LFN_SUPPORTED;
        last_drive = 0;
        return 0;
      }

- Raw text -


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