[BUG] spaces after CD command in directory hotlist

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
thcjunkee
Junior Member
Junior Member
Posts: 4
Joined: 2007-11-03, 19:15 UTC

[BUG] spaces after CD command in directory hotlist

Post by *thcjunkee »

hi all... welcome to my first post.

using v7.02a, in the directory hotlist, the following string

Code: Select all

cd{space}{space}<valid_target_dir>
- fails as a Command in the hotlist (no dir change, no warning or error)
- copy and paste to the TC command line, and it works.
- reduce number of {space} characters to 1 and it works.
- add more {space} characters and it still fails.

is this repeatable?

newbie disclaimer: sorry if this has been reported already... forum search seemed to ignore the 'cd' term

...thcjunkee
#73504 Personal Licence
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

Confirmed, hasn't been reported before afaik.

Minimum amount of chars for forum search is 3. You can use google for searching (not only in that case...):
http://www.google.com/search?q=cd+site%3Aghisler.ch%2Fboard

Icfu
This account is for sale
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

Confirmed only if hotlist path uses enviroment variable
CD{space}{space}%windir% not work
CD{space}{space}C:\windows works fine

TC 7.02a/ WinXP SP2
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

CD{space}{space}C:\windows works fine
Not confirmed, same OS, same TC version.

Icfu
This account is for sale
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

strange, after testing again CD{space}{space}C:\windows not working :oops:
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

cd{space}{space}<valid_target_dir>
Confirmed not working, TC 7.02a, Win2k SP4.
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
roentgen
Power Member
Power Member
Posts: 757
Joined: 2005-12-03, 19:58 UTC

Post by *roentgen »

Should it work? Not for me, thanks. Last time I checked "WINDOWS"≠" WINDOWS"

The real bug is that it works in TC's command line and in cmd.exe.

edit: In TC's command line it works only with full paths.
TC for Linux please!
thcjunkee
Junior Member
Junior Member
Posts: 4
Joined: 2007-11-03, 19:15 UTC

Post by *thcjunkee »

thanks, fellow humans (and/or AIs), for confirmation.

2 roentgen: my (likely not very) humble opinion:
The real bug is that it works in TC's command line and in cmd.exe.
I disagree. I don't think I would personally choose to assign significance to the quantity of whitespace between a command and the start of the command tail, so I expect the parser to eat the excess to avoid failure. I don't offhand recall encountering any exceptions to this functionality in any command parsers I've used. Truthfully I probably have encountered this behavior before and labeled dysfunctional then, also. Hell, I've probably even written a couple with this functionality - until I found out and fixed it.

peace all...out
#73504 Personal Licence
thcjunkee
Junior Member
Junior Member
Posts: 4
Joined: 2007-11-03, 19:15 UTC

Post by *thcjunkee »

This has got me thinking about ways to initiate "secret" behavior in programs by embedding specific patterns of excess whitespace in a command line. An observer might easily overlook such or consider it a mistake.

... paranoia fueling creativity ...

(edit:spelling)
#73504 Personal Licence
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

It's not a bug. " abc" is a perfectly valid directory name. Just press F7 and type " abc" without the double quotes, but with the space at the beginning.
cd<space><space>abc
will then bring you to that directory.
Author of Total Commander
https://www.ghisler.com
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

ghisler(Author) wrote:It's not a bug. " abc" is a perfectly valid directory name. Just press F7 and type " abc" without the double quotes, but with the space at the beginning.
cd<space><space>abc
will then bring you to that directory.
the problem is exist if you provide the full path
e.g. cd<spc><spc>c:\<spc>abc
thcjunkee
Junior Member
Junior Member
Posts: 4
Joined: 2007-11-03, 19:15 UTC

Post by *thcjunkee »

or, for example,
cd<spc><spc>%COMMANDER_PATH%
... which fails

IMO: eat the extra whitespace and force the user to:
cd " abc"
... when this functionality is desired.

Although... now that I know what's happening, I fixed my mind code. TC function is secondary.

2 Christian:
... taking my first opportunity to directly express my gratitude to you for writing and maintaining my most important piece of software. I thank you sincerely.
#73504 Personal Licence
User avatar
roentgen
Power Member
Power Member
Posts: 757
Joined: 2005-12-03, 19:58 UTC

Post by *roentgen »

While we're at it, let's 'cd WINDOWS' when we type 'cd CRAP'.
TC for Linux please!
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

Found many times at MS:
google (spaces double quotes site:support.microsoft.com) wrote:If the document name has spaces in it, you must wrap the URL in double-quotes.
So if I understand MS correctly, spaces are delimiters and should not belong to a name, as long as they are not included in double quotes.
Most compilers/programming languages ignore white space, too:

Code: Select all

Call CompareFunction( Parameters );
Call     CutFunction( Parameters );
Almost any program / script / batch file would stop to work if something named

Code: Select all

"    CutFunction" or " Parameters "
would be looked for here...
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
Post Reply