[SOLVED] Parameter field in dialog for defining toolbar buttons eats single quotes

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

[SOLVED] Parameter field in dialog for defining toolbar buttons eats single quotes

Post by *gdpr deleted 6 »

TC version: TC 9.51, 32-bit and 64-bit version of

The dialog for defining toolbar buttons (and probably the dialog for defining user commands in the command browser as well) has some peculiar behavior where it silently removes pairs of single quotes from the parameter field, if the single quotes are at the beginning and the end of the parameter string.

Observed behavior: TC silently messing with the Parameter field where the overall parameter string starts and ends with a single quote.

Expected behavior: TC keeping the Parameter field as specified by the user without altering it


How to reproduce:

Create a new toolbar button with the following command an parameter (what program you choose as command does not really matter, though)

Command

Code: Select all

X:\foobar
Parameter

Code: Select all

'snafu'
Note the pair of single quotes surrounding the text "snafu".

Close the toolbar button creation dialog by clicking OK.

Then edit the toolbar button again. You'll see the single quotes are gone. This should not happen. The input of the user has to be preserved as is. TC should not silently manipulate the command line parameter string.


Note that this happens only for pairs of single quotes where one quote is at the beginning and one quote is at the end of the overall parameter string.
For example, enter this parameter string:

Code: Select all

'foo' 'bar'
and TC would trim it to

Code: Select all

foo' 'bar
when closing the toolbar button definition/edit dialog.

Note that a single quote has to be both at the beginning AND the end of the overall parameter string. For example, TC won't try to remove single quotes from this parameter definition (note the absence of a single quote at the very end of the overall parameter string):

Code: Select all

'foo' bar

P.S.: Just to make clear, i am not asking for help or workarounds. I found workarounds (by surrounding the parameter string with the single quote pair with double quotes, adding another meaningless parameter argument without single quotes at the end of the parameter string). Another workaround could be to move such single-quoted parameter up into the command field, where possible. But even having found a workaround, i take issue with TC silently altering what i just deliberately typed behind my back. Bugger off TC! Just leave my toolbar button definitions alone, will you? :)
Last edited by gdpr deleted 6 on 2021-03-12, 13:28 UTC, edited 1 time in total.
User avatar
petermad
Power Member
Power Member
Posts: 14796
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Parameter field in dialog for defining toolbar buttons eats single quotes

Post by *petermad »

Behaviour confirmed - and I also find it peculiar!
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: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Parameter field in dialog for defining toolbar buttons eats single quotes

Post by *ghisler(Author) »

They probably get lost when reading from wincmd.ini - I know that this happens with double quotes, e.g. when there is
path="c:\Program files"
in an ini file and you read from it, you only get back
c:\Program files
without the double quotes. That's why TC adds exra double quotes, e.g.
path=""c:\Program files""

But I didn't know that this also happens with single quotes.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14796
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Parameter field in dialog for defining toolbar buttons eats single quotes

Post by *petermad »

They probably get lost when reading from wincmd.ini
Well since we are talking about buttons in the Button bar they must be read from .bar files - but I guess they are treated like .ini files by TC.
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: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Parameter field in dialog for defining toolbar buttons eats single quotes

Post by *ghisler(Author) »

Yes, I'm using the .ini file functions for .bar files too.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14796
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Parameter field in dialog for defining toolbar buttons eats single quotes

Post by *petermad »

history,txt wrote:24.01.21 Fixed: Button bar configuration dialogs: Single quotes around parameters and leading/trailing spaces entered in the dialog were lost (32/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
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: Parameter field in dialog for defining toolbar buttons eats single quotes

Post by *gdpr deleted 6 »

Yup, i can also confirm the fix in 10.00b1a 👍
Post Reply