From: "Zebediah Figura (she/her)" Subject: Re: [PATCH v2 5/6] robocopy: Add basic copy logic and error handling Message-Id: <042bd7fd-b597-90be-b23e-289bd26fd4ec@codeweavers.com> Date: Fri, 17 Sep 2021 01:13:07 -0500 In-Reply-To: <20210915215700.424685-5-others.meder@gmail.com> References: <20210915215700.424685-1-others.meder@gmail.com> <20210915215700.424685-5-others.meder@gmail.com> 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();