delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/11/04/10:54:02

Date: Mon, 4 Nov 1996 17:45:02 +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: Problems with opendir() and glob()
In-Reply-To: <Pine.HPP.3.95.961104120658.9556E-100000@newton.mathematik.tu-chemnitz.de>
Message-Id: <Pine.SUN.3.91.961104172009.470B-100000@is>
Mime-Version: 1.0

On Mon, 4 Nov 1996, Robert Hoehne wrote:

> reported in some other environments (network, ...) but for a
> subst drive, findfirst for "s:/" (if s is substed) does not
> report "." but findfirst for "s:/*.*" reports ".". The result of

I think that's a bug in `opendir'.  Here is a fragment which seems to be 
the culprit:

  dir->need_fake_dot_dotdot = 0;
  if (dir->name[1] == ':' && dir->name[2] == '/' && dir->name[3] == 0)
  {
    /* see if findfirst finds "." anyway */
    int done = findfirst(dir->name, &dir->ff, FA_ARCH|FA_RDONLY|FA_DIREC|FA_SYSTEM);
    if (done || strcmp(dir->ff.ff_name, "."))
      dir->need_fake_dot_dotdot = 2;
  }

Unless I miss something, it should have appended something to dir->name 
(like "/." or "/.." or "/*.*") before calling `findfirst', right?  I will 
submit the patches after trying this with `ls', if nobody tells me that 
I'm wrong.

- Raw text -


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