* * *

Author Topic: CreateRelativePath doesn't like too many dots.  (Read 199 times)

heribertB

  • Newbie
  • Posts: 1
CreateRelativePath doesn't like too many dots.
« on: August 17, 2017, 06:17:14 pm »
Hi,

I think I've detected a bug in CreateRelativePath. Simple sample code to illustrate:

Code: Pascal  [Select]
  1. writeln ( CreateRelativePath ( 'D:\D .....  .....\1\2\3\4.txt' , 'D:\D .....  .....\1' ) ) ;
  2.  
  3. writeln ( CreateRelativePath ( 'D:\D aaaaa  aaaaa\1\2\3\4.txt' , 'D:\D aaaaa  aaaaa\1' ) ) ;

results:

Code: Pascal  [Select]
  1. D:\D .....  .....\1\2\3\4.txt
  2. 2\3\4.txt

So, without dots, it works, with dots, it doesn't. I haven't checked the source yet (lack of time), but maybe someone has an idea?

Cheerio

Heribert


Bart

  • Hero Member
  • *****
  • Posts: 2718
    • Bart en Mariska's Webstek
Re: CreateRelativePath doesn't like too many dots.
« Reply #1 on: August 17, 2017, 07:14:07 pm »
There's a similar function in LazFileUtils IIRC.
You can try that.

Bart

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus