mirror of
				https://github.com/winfsp/winfsp.git
				synced 2025-10-30 19:48:38 -05:00 
			
		
		
		
	memfs: fix Unicode case-insensitive comparison
This commit is contained in:
		| @@ -212,9 +212,15 @@ int MemfsFileNameCompare(PWSTR a0, int alen, PWSTR b0, int blen, BOOLEAN CaseIns | |||||||
|  |  | ||||||
|     len = alen < blen ? alen : blen; |     len = alen < blen ? alen : blen; | ||||||
|  |  | ||||||
|     /* we should still be in the C locale */ |  | ||||||
|     if (CaseInsensitive) |     if (CaseInsensitive) | ||||||
|  |     { | ||||||
|  |         /* better Unicode comparison when case-insensitive */ | ||||||
|  |         res = CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, a, alen, b, blen); | ||||||
|  |         if (0 != res) | ||||||
|  |             res -= 2; | ||||||
|  |         else | ||||||
|             res = _wcsnicmp(a, b, len); |             res = _wcsnicmp(a, b, len); | ||||||
|  |     } | ||||||
|     else |     else | ||||||
|         res = wcsncmp(a, b, len); |         res = wcsncmp(a, b, len); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user