This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bug with gcc with findfirst/findnext


At 01:50 1998-11-04 +0100, you wrote:
>The functions _findfirst and  _findnext Will not work with the last version of gcc (mingw32).
(snip)
>int main(int argc,char *argv[])
>	printf("Listing of\t%s\n\n",argv[1]);
>	/* find the first file that matches */
>	if ((handle = FindFirstFile(argv[1],&data)) == INVALID_HANDLE_VALUE) {
(snip)
>Example of usage:
>D:\lcc\demo\findfirst>gcc findfiles.c
>D:\lcc\demo\findfirst>a
>Usage: findfiles <pattern>
>D:\lcc\demo\findfirst>a *.*
>Listing of      a.exe
>
>a.exe                                  20998 1998 Nov 04:01:33:20
>
>D:\lcc\demo\findfirst>

>What is REALLY WEIRD is that if you run the same executable that fails under
>the msvc debugger, it will work!!!

I think you might examine the 'globbing' more closely.
I think that when you run >a *.*, your main gets argc=num_files+1,
but you only FindFirstFile with the first argv[1].
Try looping over argv?

HTH

John.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]