On Mon, 2019-03-18 at 09:12 -0600, Erich E. Hoover wrote:
+ /* permit specifying tables with wildcards (Feature*) */ + if (strstrW( data->name, wildcard ) != NULL) + { + const WCHAR format[] = { '%','s','\','%','s',0 }; + WCHAR path[MAX_PATH]; + WIN32_FIND_DATAW f; + HANDLE handle;
+ long_filename = TRUE; + snprintfW( path, ARRAY_SIZE(path), format, state->table_folder, data->name ); + if ((handle = FindFirstFileW( path, &f )) == INVALID_HANDLE_VALUE) + return 0; + do + { + if (f.cFileName[0] == '.' && !f.cFileName[1]) continue; + if (f.cFileName[0] == '.' && f.cFileName[1] == '.' && !f.cFileName[2]) continue; + if (f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; + if ((ext = PathFindExtensionW( f.cFileName )) == NULL) continue; + if (lstrcmpW( ext, idt_ext ) != 0) continue; + PathRemoveExtensionW( f.cFileName ); + if (!import_table( state, f.cFileName, long_filename ))
You should allocate the path buffer dynamically. There's no need to remove the extension here either.