+Parameters size drops 253 chars after deleting a button

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

+Parameters size drops 253 chars after deleting a button

Post by *HBB »

This may be important bug.

In order to produce the bug:

1) Add the following button twice at the end of any button bar:

TOTALCMD#BAR#DATA
%COMSPEC% /k echo
########10########20########30########40########50########60########70########80########90#######100#######110#######120#######130#######140#######150#######160#######170#######180#######190#######200#######210#######220#######230#######240#######250#######260#######270#######280#######290#######300
%COMMANDER_PATH%\TOTALCMD.EXE,2
TestButton


-1


2) Remove the first added button (just before the last one)

3) The parameter size of secondly added button (last one) is automatically trimmed to 253 characters!

For general case, when a button deleted in a button bar, the parameter size of the remaining buttons are reduced to 253 characters!

EDIT > Win7x64 + TC8.51RC2
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Confirmed, thanks! The code in the 64-bit version wasn't updated for the longer parameters, only in the 32-bit version.
Author of Total Commander
https://www.ghisler.com
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

Tested with TC8.51RC3 x32 & x64 in Win7 x64 -> No problem

Note: When I copy the above button bar definition text (TOTALCMD#BAR#DATA ... -1) to clipboard and paste it on a button bar, the icon index is not considered.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Tested with TC8.51RC3 x32 & x64 in Win7 x64 -> No problem
Thanks!
Note: When I copy the above button bar definition text (TOTALCMD#BAR#DATA ... -1) to clipboard and paste it on a button bar, the icon index is not considered.
Does
%COMMANDER_PATH%\TOTALCMD.EXE
exist?

It works fine here when it does exist. If it doesn't exist, I get the default TC icon, e.g. when pasting this to a 64-bit only installation. However, it does work when I change this to
%COMMANDER_PATH%\TOTALCMD64.EXE

Can you confirm this?
Author of Total Commander
https://www.ghisler.com
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

Can you confirm this?
No. TOTALCMD.EXE and TOTALCMD64.EXE are in same dir.


I don't know how it works fine there and what is wrong in my case. When I paste the above button clipboard text to button bar, Icon file field box of the button becomes as follows :

Icon file : %COMMANDER_PATH%\TOTALCMD.EXE
or
Icon file : %COMMANDER_PATH%\TOTALCMD64.EXE

Actually it should be as follows:

Icon file : %COMMANDER_PATH%\TOTALCMD.EXE,2
or
Icon file : %COMMANDER_PATH%\TOTALCMD64.EXE,2

EDIT > Could you please try it by copying the button id text to clipboard on forum page and pasting to button bar then? May the reason be due to carriage return character?


EDIT2> Problem is this: when I paste the above button id text to button bar, icon is not displayed immediately. When I open dialog to change and just press the OK button. Icon is displayed correctly. Sorry, I couldn't define the problem correctly.
User avatar
petermad
Power Member
Power Member
Posts: 14793
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2ghisler(Author)
It works fine here when it does exist. If it doesn't exist, I get the default TC icon
I don't - I get TC's DOS icon - which I am supposed to, since that is the one that has index 2 - so how can you get icon 0?
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
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I only get icon 0 when the program file
%COMMANDER_PATH%\TOTALCMD.EXE
does NOT exist.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14793
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

When %COMMANDER_PATH%\TOTALCMD.EXE does not exist (running 64bit version installed non-combined with 32bit version) I get a blank icon - is that what you call "the default TC icon" ?
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
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

No, I get a TC floppy icon in this case.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14793
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Hmm, I can't make that happen - can anyone else?
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
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

petermad wrote:
When %COMMANDER_PATH%\TOTALCMD.EXE does not exist (running 64bit version installed non-combined with 32bit version) I get a blank icon
1) I paste the button clipboard text to a button bar
2) Even if %COMMANDER_PATH%\TOTALCMD.EXE exist (running 64bit version installed combined with 32bit version) I still get a blank icon.
3) After Right mouse click + change => I see Icon number as 2 (even if the icon is not displayed on button).

Is this normal? Doesn't TC display/refresh the icon on button immediately?


petermad wrote:
Hmm, I can't make that happen - can anyone else?
1) I renamed TOTALCMD.EXE to TOTALCMDxxx.EXE temporarily
2) After I paste the button clipboard text to a button bar, I still get blank icon.
3) After Right mouse click + change => I see Icon number as 2 (but icon previews are not displayed)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Hmm, no idea why I get a floppy icon - maybe because I have totalcmd.exe somewhere in the path. Anyway, it is irrelevant here, it only matters what happens when the icon file does exist.
Author of Total Commander
https://www.ghisler.com
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

May the reason be that TC does not resolve the %COMMANDER_PATH% for this case?
EDIT> Sorry, It is not.

EDIT2> I think I found the problem in my case.

The reason of the blank icon is a space character at last in the icon definition string : %COMMANDER_PATH%\TOTALCMD.EXE,2

When I remove that space character at last, icon is displayed correctly after paste. I don't know how it came to there. But, I see that this is open to have mistake.

Before paste, is it possible to remove the preceding/following spaces (trim) in the line(s) of button clipboard text?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Ah, I see - some browsers seem to copy a space at the end of a line although there isn't any.
Before paste, is it possible to remove the preceding/following spaces (trim) in the line(s) of button clipboard text?
This function was meant to be used together with "Copy" from the same context menu, which doesn't append any unnecessary spaces...
Author of Total Commander
https://www.ghisler.com
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

If there is nothing to do, let's be carefull.

I supposed that the above clipboard text is parsed in codes, and the line blongs to icon definition may be trimmed programmatically inside the codes.
Post Reply