Project

General

Profile

Bug #87

ParseFolderName: if filename part of path then not returning correct path

Added by Wil van Antwerpen over 6 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
Normal
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 over 6 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!

Also available in: Atom PDF