From: Gabriel Ivăncescu Subject: [PATCH] ntdll: Simplify the file_part finder in RtlDosPathNameToNtPathName_U_WithStatus Message-Id: Date: Thu, 23 Aug 2018 17:15:02 +0300 Path is known to start with \??\ in this block, so strrchrW cannot ever return NULL, thus there is no reason to check for it. Signed-off-by: Gabriel Ivăncescu --- dlls/ntdll/path.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c index ccc95e3..d2e70bb 100644 --- a/dlls/ntdll/path.c +++ b/dlls/ntdll/path.c @@ -366,8 +366,8 @@ NTSTATUS WINAPI RtlDosPathNameToNtPathName_U_WithStatus(const WCHAR *dos_path, U ntpath->Buffer[1] = '?'; /* change \\?\ to \??\ */ if (file_part) { - if ((ptr = strrchrW( ntpath->Buffer, '\\' )) && ptr[1]) *file_part = ptr + 1; - else *file_part = NULL; + ptr = strrchrW(ntpath->Buffer, '\\'); + *file_part = ptr[1] ? ptr + 1 : NULL; } return STATUS_SUCCESS; } -- 1.9.1