Menu

#5 Error in ExtractFileNeme, ExtractFileExt, ExtractFilePath, WStrRScan

v1.0 (example)
closed
nobody
None
5
2021-03-05
2018-02-16
No

Hi,
the ExtractFileName, ExtractFileExt and ExtractFileName functions do not give the expected result with Delphi 10.1 Berlin and above

Correction proposal
replace the WStrRScan function with the following
function WStrRScan(Str: PWideChar; Chr: WideChar): PWideChar;
begin
Result := nil;
while Str^ <> #0 do begin
if Str^ = Chr then
Result := Str;
inc(Str);
end;
// Return nil if string not found
// if Result = nil then
// Result := Str;
end;

Discussion

  • DWorker

    DWorker - 2018-02-21

    Some busy right now for fix this. But I'll check it asap. The main thing that fix did not break something else

     
  • Hubert Bannwarth

    I checked WStrRscan, it seems only used with the finemale related functions on unicode versions

    I use it in a little applauncher project using only file acces, reading, run another process and display a splash screen with a progress bar

     
  • DWorker

    DWorker - 2021-03-05

    Thank you, fixed

     
  • DWorker

    DWorker - 2021-03-05
    • status: open --> closed
     

Log in to post a comment.