X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Thu, 6 Dec 2001 11:54:42 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Jeff Powell cc: djgpp AT delorie DOT com Subject: Re: Broken findfirst In-Reply-To: <200112060755.fB67t7o09839@ygtynecs01097a.ygt-ynec-spc> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 6 Dec 2001, Jeff Powell wrote: > And compiling the file as .c yields the same results. Here is the whole file. > > #include > //#include > #include > #include > #include > > main(int ac, char **av) > { > struct ffblk f; > int iFndStatus; > char cDrv[MAXDRIVE]; > char cDir[MAXDIR]; > char cNam[MAXFILE]; > char cExt[MAXEXT]; > char *MyStr; > > // _use_lfn(av[1]); > fnsplit(av[1],cDrv, cDir, NULL, NULL); I'm guessing that you invoked your program like this: yourprog C:\*.* Is that right? If so, av[1] didn't contain "C:\*.*", but the first file in the C:\ directory. That's because the DJGPP startup code automatically expands wildcards in all the command-line arguments. If you want to pass the literal "C:\*.*" to a program, enclose it in double or single quotes. When I do that, your program works for me as you'd expect: it prints all the files in the C:\ directory. (That's why I asked you to tell what's in av[1], but I guess you didn't actually look... ;-)