[fpc-devel] ExtractFileDrive is broken under Linux

Graeme Geldenhuys graemeg.lists at gmail.com
Wed May 21 12:16:58 CEST 2008


I reported this bug since FPC 2.0.2 as Mantis Bug #6491

The bug report contains a test application. Using FPC 2.0.2, 2 out of 
the 8 tests failed. The result were consistent under Linux and Windows. 
  Now with FPC 2.2.1, all tests pass under Windows, but all tests _fail_ 
under Linux! Now it's even worse. :-(

The same with 'example34' mentioned in the FPC documentation. See the URL.


---------- FPC 2.2.1 under Linux ---------------
FileName      : c:\pp\bin\win32\ppc386.exe
Has Name      : ppc386.exe
Has Path      : c:\pp\bin\win32\
Has Extension : .exe
Has Directory : c:\pp\bin\win32
Has Drive     :

The last line 'Has Drive' should have reported 'c:' as the result. 
         Irrespective of the platform I am running on, if I pass in a 
windows filename like 'c:\pp\bin\win32\ppc386.exe', I expect it to exact 
the drive letter correctly, given the parameter in question.

Or am I missing the point here??  It seems the behaviour of 
ExtractFileDrive() now looks at the platform it's running on, and just 
because Linux doesn't use drive letters, it immediately thinks the 
filename passed in doesn't contain a drive letter. Applying such Linux 
specific behaviour inside ExtractFileDrive() in not correct.
What if I use a Linux application to process data from a remote Windows 
system?? I'm now getting inconsistent results!

   - Graeme -

fpGUI - a cross-platform GUI toolkit using Free Pascal

More information about the fpc-devel mailing list