int findex, len;
char win32pattern[MAXNAMLEN+3];
HANDLE fh;
+ int errm;
/*
* Much of the following code and comments were taken from dired.c.
*/
findex = 0;
fh = INVALID_HANDLE_VALUE;
+ errm = SetErrorMode (SEM_FAILCRITICALERRORS
+ | SEM_NOOPENFILEERRORBOX);
while (1)
{
fh = FindFirstFile(win32pattern, &files[findex]);
if (fh == INVALID_HANDLE_VALUE)
{
+ SetErrorMode (errm);
report_file_error ("Opening directory",
list1(build_string(dirfile)));
}
break;
}
FindClose(fh);
+ SetErrorMode (errm);
report_file_error ("Reading directory",
list1(build_string(dirfile)));
}
*nfiles = findex;
break;
}
+
+ SetErrorMode (errm);
return (files);
}