>> It seems you rather created a new problem for *nix 
>> users. As a rule: never transform casing of paths 
>> and filenames in portable code, and use hb_FileMatch() 
>> to check for equality of filenames and paths. This 
>> will do case sensitive comparison on *nixes and case 
>> insensitive ones on win/dos/os2.
>> 
> 
> I could not get the whole concept.

I told it above :)

> I am storing the filename as is selected. Before, I was 
> lower-casing them. So the situation is exactly the same
> in both cases. I never used hb_FileMatch(), can you 
> fix this code to allow projects to be portable on 
> any platforms and at the same time sources be 
> located accordingly ?

I'd feel it better if you'd understand the concept 
and keep it fixed in the future. F.e. if you look 
for a file names "Hello.prg" on Linux, it's not 
good to use 'LOWER( "Hello.prg" ) == fn' when looking 
it up in a list of filenames, as there might also exist 
a "hello.prg" which is a different file. So it's 
better to use hb_FileMatch( "Hello.prg", fn ) instead.
The only place where you want to keep using LOWER(), 
is when looking for file types:
   LOWER( ExtOf( "Hello.PRG" ) ) == ".prg"

Here is your patch:
---
-   cLPath := hbide_pathNormalized( cPath, .t. )
-   IF left( cLPath, len( cLRoot ) ) == cLRoot
+   cLPath := hbide_pathNormalized( cPath, .f. )
+   IF left( lower( cLPath ), len( cLRoot ) ) == cLRoot
---

You've added a LOWER() call to a comparison, which 
won't remove any code which converts filenames to 
lowercase, and as I understand this was the problem 
of original poster ("For example file name is Main.prg but
in project list is main.prg").

I hope that help, or others can jump in.

Viktor

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to