[TC 10.52rc1] Running cm_exit with random parameters

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Elwin_Ransom
Junior Member
Junior Member
Posts: 38
Joined: 2022-07-31, 18:14 UTC
Location: Perelandra

[TC 10.52rc1] Running cm_exit with random parameters

Post by *Elwin_Ransom »

Place the cursor on the command line.
Type any word

Code: Select all

cm_exit yahooooo
press Enter — this will restart TC.
Type any sequence of numbers

Code: Select all

cm_exit 1234567890
press Enter — this will switch TC architecture.
User avatar
petermad
Power Member
Power Member
Posts: 14700
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC 10.52rc1] Running cm_exit with random parameters

Post by *petermad »

Confirmed.

I would expect TC just to exit with these two examples
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Fla$her
Power Member
Power Member
Posts: 2223
Joined: 2020-01-18, 04:03 UTC

Re: [TC 10.52rc1] Running cm_exit with random parameters

Post by *Fla$her »

Elwin_Ransom wrote: 2022-10-09, 21:22 UTCType any sequence of numbers

Code: Select all

cm_exit 1234567890
press Enter — this will switch TC architecture.
This is expected. Can be easily checked on .vbs:

Code: Select all

Test 1
Test 2
Test 4

Sub Test(N)
   If (1234567890 And N) = N Then MsgBox N & " accounted in the sum"
End Sub
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48005
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 10.52rc1] Running cm_exit with random parameters

Post by *ghisler(Author) »

cm_exit yahooooo
This uses the character code of the first character as parameter. This is done for CM_*OPENDRIVES, where you can specify either
CM_SRCOPENDRIVES 67
or
CM_SRCOPENDRIVES C
or
CM_SRCOPENDRIVES c

The special handling isn't limited to specific commands, so you get this strange behaviour here. "y" is converted to 110.
cm_exit 1234567890
As Fla$her writes, the numeric parameter is a sum, and higher additions are ignored because they might be added in later versions.
Author of Total Commander
https://www.ghisler.com
User avatar
Elwin_Ransom
Junior Member
Junior Member
Posts: 38
Joined: 2022-07-31, 18:14 UTC
Location: Perelandra

Re: [TC 10.52rc1] Running cm_exit with random parameters

Post by *Elwin_Ransom »

2ghisler(Author)
Thank you very much for the explanation. But
"y" is converted to 110
Maybe you meant that the "y" is converted to 121? Did you mean the ASCII code of the "y" character or something else?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48005
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 10.52rc1] Running cm_exit with random parameters

Post by *ghisler(Author) »

Yes, 121 is correct. 110 would be "n".
Author of Total Commander
https://www.ghisler.com
Post Reply