%M and %N are not properly quoted after %X

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

%M and %N are not properly quoted after %X

Post by *MVV »

Use any button (e.g. calc.exe) with following parameter line:

Code: Select all

?%N "%M" =%X= %N "%M"
1. Focus files with spaces in names in both panels. Activate left panel and click the button. All names are quoted correctly.
2. Now activate right panel and click the button. Quotes are messed up.

It would be more user-friendly to use similar quoting rules for both %N and %M. BTW, I think it won't hurt to always quote %N/%M (maybe with additional INI option).

Tested with TC 8.01x32.
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

Confirmed with tc80.1 x64

In case of (2) the second %M parameter is double quoted while the second %N parameter is not quoted.

Regards
Holger
Make our planet great again
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This isn't a bug - when you use %X, TC replaces %N by %M and %M by %N. Only %P, %N and %P%N are auto-quoted.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Only %P, %N and %P%N are auto-quoted.
But it isn't true after %X so it is impossible to use %N or %M after %X because of unexpected behaviour. Example is here: if left panel is active, TC doesn't exchange %N and %M, but if right one is active, TC does (so it doesn't quote %N). So any button with %N or %M after %X will work only in half of cases if names contain spaces (when specific panel is active). Isn't it a bug?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, that's how it works. TC just uses search+replace after %X.
Author of Total Commander
https://www.ghisler.com
Post Reply