[TC 10.50b2] %M does not automatically add quotation marks to names with spaces as %N does

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
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

[TC 10.50b2] %M does not automatically add quotation marks to names with spaces as %N does

Post by *petermad »

Picking up on this thread https://www.ghisler.ch/board/viewtopic.php?p=396234#p396234 - I still see the difference between the command parameters %N and %M - where %N adds quotation marks when there are spaces in the filename, while %M does not - it is possible to make the behavior consistent so %M also adds quotation marks?
Last edited by petermad on 2022-04-28, 01:26 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.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 10.50b2] %M does not automatically add quotation marks to names with spaces as %N does

Post by *ghisler(Author) »

Only %P%N and %T%M officially add quotes around the name if there are spaces. For others, please add quotes yourself.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC 10.50b2] %M does not automatically add quotation marks to names with spaces as %N does

Post by *petermad »

I am sorry, but %N also gets quoted when there is spaces in the name - at least when used in a button like this:

Code: Select all

TOTALCMD#BAR#DATA
cd
?%N
%COMMANDER_EXE%,6
%N test 


-1
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
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 10.50b2] %M does not automatically add quotation marks to names with spaces as %N does

Post by *ghisler(Author) »

You are right, %S and %P%S also automatically adds quotes. However, I may break a lot of people's buttons when I surrounded all %M with quotes, e.g. when they have something like %P%M or other unusual combinations. :(
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC 10.50b2] %M does not automatically add quotation marks to names with spaces as %N does

Post by *petermad »

%P%M is already sourrounded by quotes when spaces in the name - as is %T%M.

I am only talking about standalone "%M" - IF anybody already has put quotes around %M then the result will just be ""file name"" - in most cases that is not a problem. DOS commands does not haven problems with ""file name"".
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: 2244
Joined: 2020-01-18, 04:03 UTC

Re: [TC 10.50b2] %M does not automatically add quotation marks to names with spaces as %N does

Post by *Fla$her »

ghisler(Author) wrote: 2022-04-28, 07:48 UTCHowever, I may break a lot of people's buttons when I surrounded all %M with quote
Then why did you add quotes for %N? Previously, users also created buttons by enclosing %N in quotation marks.
Last edited by Fla$her on 2022-04-29, 22:13 UTC, edited 1 time in total.
Overquoting is evil! 👎
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: [TC 10.50b2] %M does not automatically add quotation marks to names with spaces as %N does

Post by *Hacker »

Fla$her,
Previously, users also created buttons by enclosing %N in quotation marks.
When would that have been?

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.
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC 10.50b2] %M does not automatically add quotation marks to names with spaces as %N does

Post by *petermad »

When would that have been?
Good question, I went back and tested version 4.51 from 2000 - it also quotes %N automatically so there have never been a need for the user to manually put them around %N
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: 2244
Joined: 2020-01-18, 04:03 UTC

Re: [TC 10.50b2] %M does not automatically add quotation marks to names with spaces as %N does

Post by *Fla$her »

When would that have been?
I was wrong. This was about ampersands, not spaces.
04.09.15 Fixed: Button bar: put parameter %P%N in double quotes not only when the name contains a space, but also for '&' (needed for cmd.exe) (32/64)
Overquoting is evil! 👎
Post Reply