[9.21a] Cd doesn't normalize paths

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: [9.21a] Cd doesn't normalize paths

Post by *MVV »

JOUBE,
You simply don't know how many checks TC does for different incorrectly configured environments...
But in this case simple normalization function call could fix many unobvious troubles. Unobvious because it is completely unclear that TC can't view file in nested archive because of an extra backslash in TEMP variable, and because such path is completely valid in Windows.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48229
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [9.21a] Cd doesn't normalize paths

Post by *ghisler(Author) »

TC already removes duplicate backslashes when an environment variable contains one at the end and the user also specifies it. But it doesn't try to fix duplicate backslashes in the middle of such variables.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: [9.21a] Cd doesn't normalize paths

Post by *MVV »

Isn't it easy to normalize resulting path before using it in a panel or whatever else? Does TC normalize path to temporary directory while resolving path to its _tc dir? Looks like no, and I don't understand why, it is so easy...
JOUBE
Power Member
Power Member
Posts: 1506
Joined: 2004-07-08, 08:58 UTC

Re: [9.21a] Cd doesn't normalize paths

Post by *JOUBE »

MVV wrote: 2023-12-26, 06:42 UTC Isn't it easy to normalize resulting path before using it in a panel or whatever else? Does TC normalize path to temporary directory while resolving path to its _tc dir? Looks like no, and I don't understand why, it is so easy...
Of course that would be easy, but the Tc is a tool that should respect the user's input and not manipulate it. (A comparable example: w.google.com gives an error message from google even though it would be easy for google to redirect to www.google.com)
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: [9.21a] Cd doesn't normalize paths

Post by *MVV »

TC is a file manager and should operate with file system paths, and if a path may be represented in a different ways, all of them should be supported by a file manager. If a path with doubled backslash in the middle is valid for filesystem, it should be valid for a file manager too.
Path normalization is not a manipulation, it just switches between different representations of the same path (e.g. C:\Dir1\file.txt and C:/Dir1\\Dir2\..\.\file.txt represent the same path while in your example w.google.com and www.google.com are different paths), and it is necessary here because some TC code evidently doesn't support all representations of paths.
JOUBE
Power Member
Power Member
Posts: 1506
Joined: 2004-07-08, 08:58 UTC

Re: [9.21a] Cd doesn't normalize paths

Post by *JOUBE »

MVV wrote: 2024-01-10, 08:21 UTC (e.g. C:\Dir1\file.txt and C:/Dir1\\Dir2\..\.\file.txt represent the same path
;-) ... \\ cheated in between... And "same path"? No, if microsoft manipulates the path it is disrespectful to the user.
Post Reply