Piotr Caban piotr@codeweavers.com writes:
@@ -359,6 +360,51 @@ void msvcrt_free_args(void) HeapFree(GetProcessHeap(), 0, MSVCRT__wenviron); HeapFree(GetProcessHeap(), 0, MSVCRT__pgmptr); HeapFree(GetProcessHeap(), 0, MSVCRT__wpgmptr);
- HeapFree(GetProcessHeap(), 0, argv_expand);
+}
+static int build_expanded_argv(int *argc, char **argv) +{
- int i, size=0, args_no=0;
- HANDLE h;
- args_no = 0;
- for(i=0; i<__wine_main_argc; i++) {
WIN32_FIND_DATAA data;
int len = 0;
h = FindFirstFileA(__wine_main_argv[i], &data);
if(h != INVALID_HANDLE_VALUE) {
do {
if(data.cFileName[0]=='.' && (data.cFileName[1]=='\0' ||
(data.cFileName[1]=='.' && data.cFileName[2]=='\0')))
continue;
len = strlen(data.cFileName)+1;
if(argv) {
argv[args_no] = (char*)(argv+*argc)+size;
memcpy(argv[args_no], data.cFileName, len*sizeof(char));
}
That won't work if the wildcard contains a path.