[PATCH 2/2] msidb: Add support for wildcard table import.

Hans Leidekker hans at codeweavers.com
Mon Mar 18 14:54:16 CDT 2019


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.




More information about the wine-devel mailing list