Bug #87
ParseFolderName: if filename part of path then not returning correct path
Start date:
09/05/2017
Due date:
% Done:
0%
Description
From: Clayton
I found a possible bug using ParseFolderName function.
If the contents of sFile is part of the direcories names in sFileName, the replace function change the first ocurrence of the substring.
To fix this a replaced the line:
Move (Replace(sFile,sFileName,"")) To sFolderName
With:
Move (Left(sFileName,Length(sFileName)-Length(sFile))) to sFolderName
Hope I made myself clear.
Thanks in advance.
Have a nice day.
History
#1 Updated by Wil van Antwerpen about 7 years ago
- Status changed from New to Resolved
- Assignee set to Wil van Antwerpen
As replace was used to trim the filename from the path it ended up replacing the first occurence which was the path and not the filename.
Eg. it would do this:
C:\test.txt\test.txt -> C:\test.txt
C:\mytest.txt\test.txt -> c:\my\test.txt
This has been fixed. Thanks Clayton!