[PATCH v2 5/6] robocopy: Add basic copy logic and error handling

Zebediah Figura (she/her) zfigura at codeweavers.com
Fri Sep 17 01:13:07 CDT 2021


On 9/15/21 16:56, Florian Eder wrote:
> @@ -145,6 +162,134 @@ static void parse_arguments(int argc, WCHAR *argv[])
>       }
>   }
>   
> +static BOOL matches_array_entry(WCHAR *name, struct path_array *names_to_match)

Nitpicking the naming again, but "matches_array_entry" is a bit 
ambiguous as it doesn't say what's in the array. Maybe "path_in_array"?

On the other hand, "names_to_match" is more verbose than it needs to be; 
we can already tell what the function is doing, so I'd shorten it to 
"names" (or "paths" or something).

> +{
> +    int i;
> +    for (i = 0; i < names_to_match->size; i++)
> +    {
> +        if (PathMatchSpecW(name, names_to_match->array[i])) return TRUE;
> +    }
> +    return FALSE;
> +}
> +

...

> @@ -166,8 +311,25 @@ int __cdecl wmain(int argc, WCHAR *argv[])
>   {
>       parse_arguments(argc, argv);
>   
> +    /* If no file filters are set, set *.* to include all files */
> +    if (options.files->size == 0)
> +    {
> +        options.files->array[options.files->size] = calloc(64, sizeof(WCHAR));
> +        wcscpy(options.files->array[0], L"*.*");

How about "wcsdup(L"*.*")"?

> +        options.files->size++;
> +    }
> +
>       print_header();



More information about the wine-devel mailing list