www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/27/06:29:07

Date: Wed, 27 Nov 1996 13:13:33 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Jean-Gakl GRICOURT <jean-gael DOT gricourt AT snet DOT net>
Cc: djgpp AT delorie DOT com
Subject: Re: Readdir() function ?
In-Reply-To: <329B32E8.793@snet.net>
Message-Id: <Pine.SUN.3.91.961127130633.6485A-100000@is>
Mime-Version: 1.0

On Tue, 26 Nov 1996, Jean-Gakl GRICOURT wrote:

>     - no argument -> memory fault.

When you call a program with no arguments, argv[1] is a null pointer.  
While it is generally desirable that library functions be protected 
against such calamities, IMHO anybody who passes a null pointer to a 
library function is looking for trouble.  For example, try something like 
``strcpy (0, "You're gonna crash!")'' and watch the fun.

>     - arg="\"     -> don't list the root of the disk.
>     - arg=".."    -> don't list the root if ".." is really linked to the
> root.

These two work for me as you'd expect; they even simulate (the
nonexistent) "." and ".." entries in the root directory.  What version of
DJGPP are you using?  `readdir' has been changed in v2.01, so maybe you 
are using an old version?

- Raw text -


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