I’m trying to figure out ExtractRelativePath() and I’ve run the sample program 
found here:

https://www.freepascal.org/docs-html/rtl/sysutils/extractrelativepath.html

 

I get the following results from the sample (with a few test I threw in myself):

>From "/pp/src/compiler" to "/pp/bin/win32/ppc386" via "..\bin\win32\ppc386"    
>// Shouldn’t this be “..\..\bin\win32\ppc386” ?

>From "/pp/bin/win32/ppc386" to "/pp/src/compiler" via "..\..\src\compiler"     
>      // Shouldn’t this be "..\..\..\src\compiler" ?

>From "e:/pp/bin/win32/ppc386" to "d:/pp/src/compiler" via "d:/pp/src/compiler" 
>//Expected

>From "e:\pp\bin\win32\ppc386" to "d:\pp\src\compiler" via "d:\pp\src\compiler" 
>//Expected

>From "C:\FPC\3.0.2" to "C:\FPC\3.0.2" via "3.0.2"                              
>                               // Shouldn’t this be “”  since we are already 
>there?

>From "C:\FPC\3.0.2" to "C:\FPC\3.0.4rc1" via "3.0.4rc1"                        
>                          // Shouldn’t this be "..\3.0.4rc1"?

>From "Q:\" to "Q:\FPC\3.0.4rc1" via "FPC\3.0.4rc1"                             
>                             //Expected

 

Am I missing something here?

 

James

 

 

 

 

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to