Signed-off-by: YeshunYe yeyeshun@uniontech.com
find supports /I for case-insensitive search. In practice, however, find /i also works (tested on WinXP, Win7, and Win10).
-- v2: find: Support switch /i or /I
From: YeshunYe yeyeshun@uniontech.com
Signed-off-by: YeshunYe yeyeshun@uniontech.com --- programs/find/Makefile.in | 2 +- programs/find/find.c | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/programs/find/Makefile.in b/programs/find/Makefile.in index 2d8469f6317..b82198bee70 100644 --- a/programs/find/Makefile.in +++ b/programs/find/Makefile.in @@ -1,5 +1,5 @@ MODULE = find.exe -IMPORTS = user32 +IMPORTS = user32 kernelbase
EXTRADLLFLAGS = -mconsole -municode
diff --git a/programs/find/find.c b/programs/find/find.c index b4eb4d1949b..29417111945 100644 --- a/programs/find/find.c +++ b/programs/find/find.c @@ -25,6 +25,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(find);
+static int flag_case_sensitive = 1; + static BOOL read_char_from_handle(HANDLE handle, char *char_out) { static char buffer[4096]; @@ -120,7 +122,7 @@ static BOOL run_find_for_line(const WCHAR *line, const WCHAR *tofind) if (lstrlenW(line) == 0 || lstrlenW(tofind) == 0) return FALSE;
- found = wcsstr(line, tofind); + found = flag_case_sensitive ? wcsstr(line, tofind) : StrStrIW(line, tofind);
if (found) { @@ -160,8 +162,17 @@ int __cdecl wmain(int argc, WCHAR *argv[]) { if (argv[i][0] == '/') { - output_resource_message(IDS_INVALID_SWITCH); - return 2; + switch (argv[i][1]) + { + case 'i': + case 'I': + flag_case_sensitive = 0; + break; + + default: + output_resource_message(IDS_INVALID_SWITCH); + return 2; + } } else if (tofind == NULL) {
On Tue May 13 00:58:04 2025 +0000, Yeshun Ye wrote:
changed this line in [version 2 of the diff](/wine/wine/-/merge_requests/8005/diffs?diff_id=177232&start_sha=b64315964b7bf570d47b3ef73964b83c676ee623#183692aca9f6973117933319ef55f8c1b69e53cb_2_2)
done.
This merge request was approved by Hans Leidekker.