[Solved] Peculiar bug when editing a button

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
petermad
Power Member
Power Member
Posts: 14825
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

[Solved] Peculiar bug when editing a button

Post by *petermad »

This only affects the 64bit version of TC - but all the way back to TC 8.0 (x64)
  1. Open a button in the button bar, preferably one that has the "Parameters" field filled out.
  2. Delete the current "Command" and type xc
  3. The "Parameters" and the "Start path" gets deleted and inactivated - just like if a cm_ or em_ command is chosen via the button with the magnifying glass.
  4. Type one more character - the "Parameters" and the "Start path" gets reactivated (but are still blank).
  5. It also happens if I paste xc from the Clipboard - so it is not the keystrokes xc that does it - it is the string xc.
Last edited by petermad on 2021-03-13, 03:29 UTC, edited 1 time in total.
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6507
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Peculiar bug when editing a button

Post by *Horst.Epp »

Confirmed
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.78
QAP 11.6.3.3 x64
User avatar
Gral
Power Member
Power Member
Posts: 1468
Joined: 2005-01-26, 15:12 UTC

Re: Peculiar bug when editing a button

Post by *Gral »

Confirmed - only x64 version, 32 bit not affected.
Also: "xa" "xb" "xc" "xd" "xe" "xf" works the same way and you can add more a,b,c,d,e,f - "Parameters" and "Start path" still not active - you must add letter behind f to reactivate
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: Peculiar bug when editing a button

Post by *gdpr deleted 6 »

Confirmed.
And it is not just "xc" or similar triggering this effect.

As it looks like, TC 64-bit tries to parse the command string as an integer number.
Seems the wrong input validation code has been wired up/reused incorrectly...


Any hex number of up to 16 digits (= 64-bit value) with a "x" prefix and an optional +/- sign triggers the effect.

Decimal integer numbers with an optional +/- sign will trigger the effect, as long as the value fits into 64 bits (as a signed 64-bit integer type, value range [-9223372036854775808, +9223372036854775807]).

Binary numbers with a "%" prefix are joining the fun as well (assuming they fit into 64-bit, i guess).

And octals. What would be a party without the octals? Just use the "&" prefix for octals, and there you go. (Again, 64-bit limit seems to apply).

Is there any common numeral system i forgot? :P
User avatar
Hacker
Moderator
Moderator
Posts: 13073
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Peculiar bug when editing a button

Post by *Hacker »

elgonzo,
Is there any common numeral system i forgot?
Roman.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: Peculiar bug when editing a button

Post by *gdpr deleted 6 »

Hacker wrote: 2020-09-04, 22:18 UTC Roman.

Roman
:D :D :D
User avatar
petermad
Power Member
Power Member
Posts: 14825
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Peculiar bug when editing a button

Post by *petermad »

As it looks like, TC 64-bit tries to parse the command string as an integer number.
That makes sence, since you are allowed to enter the number of any cm_command ins stead of the command name, and that explains why the "Parameters" and "Start path" fields are disabled like when you enter and cm_command - actually as soon as you have entered cm_ or em_

The best would be if TC only considered decimal numbers between 100 and 8999 as internal commands.
Last edited by petermad on 2020-09-05, 10:14 UTC, edited 1 time in total.
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: Peculiar bug when editing a button

Post by *gdpr deleted 6 »

Your explanation made me check the 32-bit version again. Unsurprisingly, it exhibits a similar and closer to the intended but unfortunately undocumented behavior (or the documentation for this is well hidden). The 32-bit version only successfully parses decimal signed 32-bit integers. Neither hex, binary nor octal numbers are parsed (at least not with the prefixes x/%/&).
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48112
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Peculiar bug when editing a button

Post by *ghisler(Author) »

Interesting, I didn't know that the Lazarus val() command would recognize such strings as hexadecimal. Numeric values are indeed supported, and both the decimal and hexadecimal (with $ at the start) variations are allowed.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14825
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Peculiar bug when editing a button

Post by *petermad »

history.txt wrote:03.09.20 Fixed: Button bar: Hex strings in the form "xc" were detected as internal numeric commands by mistake (64)
Confirmed fixed in TC 10 b1a :-)
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply