Euphoria
Ticket #615:
abbreviate_path() in Windows does not handle uppercase argument correctly
-
Reported by
DerekParnell
Feb 16, 2011
If the first argument to abbreviate_path() contains uppercase characters, the function returns the first argument rather than abbreviate it.
Details
1. Comment by mattlewis
Feb 16, 2011
Can you provide some failing code (or commit a test)? The following works for me:
-- bug.ex
include std/filesys.e
printf(1, "%s\n", { abbreviate_path( "/Abc/Def", {"/Abc/"})})
$ eui bug
Def
2. Comment by DerekParnell
Feb 16, 2011
The following code fails for me ...
-- bug.ex
include std/filesys.e
printf(1, "%s\n", { abbreviate_path( "/Abc/Def", {"/Abc/"})})
Result is ...
/Abc/Def
The problem is that IN WINDOWS the base_paths list is converted to lower case and then the expanded_path variable is compared to the converted base_paths.
The trick will be to do efficient case-insensitive compares in Windows but return the abbreviated result in its original case.
3. Comment by DerekParnell
Feb 16, 2011
I'm working with
Euphoria Interpreter v4.0.1 development Windows, Using Managed Memory Revision Date: 2011-02-10 14:58:09, Id: 4635:d18b35de37bf
4. Comment by SDPringle
Feb 17, 2011
fixed in 4274:cdfdfc81907e
5. Comment by SDPringle
Feb 17, 2011
See: hg:euphoria/rev/6a0a96753976
changeset: 4658:6a0a96753976 branch: 4.0 tag: tip user: Shawn Pringle <shawn.pringle@gmail.com> date: Thu Feb 17 16:36:39 2011 -0300 files: docs/release/4.0.1.txt description: fixes ticket:615
6. Comment by DerekParnell
Feb 26, 2011
I'm sorry but this is still not working (in branch 4.0).
I'm getting this error ...
failed: abbreviate_path, expected: "tests\\t_filesys.e" but
got: "C:\\Projects\\eu_proj\\HGProj\\euphoria\\tests\\t_filesys.e"
7. Comment by DerekParnell
Feb 26, 2011
See: hg:euphoria/rev/c131a87ee326
changeset: 4677:c131a87ee326 branch: 4.0 tag: tip user: DerekParnell date: Sun Feb 27 09:09:47 2011 +1100 files: include/std/filesys.e description: fixes ticket 615. Now works in Windows taking drive id, slashes and case into consideration.