2 * Globbing for NT. Relies on the expansion done by the library
3 * startup code (provided by Visual C++ by linking in setargv.obj).
6 /* Enable wildcard expansion for gcc's C-runtime library if not enabled by
7 * default (currently necessary with the automated build of the mingw-w64
8 * cross-compiler, but there's no harm in making sure for others too). */
11 #if defined(__MINGW64_VERSION_MAJOR) && defined(__MINGW64_VERSION_MINOR)
27 main(int argc, char *argv[])
33 char volname[MAX_PATH];
34 DWORD serial, maxname, flags;
37 /* check out the file system characteristics */
38 if (GetFullPathName(".", MAX_PATH, root, &dummy)) {
39 dummy = strchr(root,'\\');
42 if (GetVolumeInformation(root, volname, MAX_PATH,
43 &serial, &maxname, &flags, 0, 0)) {
44 downcase = !(flags & FS_CASE_IS_PRESERVED);
48 setmode(fileno(stdout), O_BINARY);
49 for (i = 1; i < argc; i++) {
50 len = strlen(argv[i]);
53 if (i > 1) fwrite("\0", sizeof(char), 1, stdout);
54 fwrite(argv[i], sizeof(char), len, stdout);