[TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"

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

Moderators: petermad, Stefan2, white, Hacker

Post Reply
User avatar
white
Power Member
Power Member
Posts: 6888
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

[TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"

Post by *white »

(Issue mentioned earlier here)

Create a button with this cm_Edit command:
cm_Edit /GCN="<test[Q]"

[Q] is not an allowed placeholder at this time, so this is a syntax error in the filename specification and executing the command shows the new file dialog with "<Error!>" in the preview.
Pressing Shift+F4 and typing "<test[Q]", causes the error to be displayed as well.

Now change the button mentioned before by removing "GC", so it leaves this command:
cm_Edit /N="<test[Q]"

Despite the syntax error in the filename specification, this results in "d:\somedir\<test[Q]" being passed to the editor. In my opinion, that shouldn't happen.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 52921
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"

Post by *ghisler(Author) »

Without "C", this goes to the function which directly opens a file, e.g. because you pressed F4 on it. Therefore it doesn't do any name checks.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 6888
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"

Post by *white »

ghisler(Author) wrote: 2026-05-08, 15:09 UTC Without "C", this goes to the function which directly opens a file, e.g. because you pressed F4 on it. Therefore it doesn't do any name checks.
Doesn't do any name checks? So using valid placeholders doesn't work? For example:
cm_Edit /N="<test[YMD]"
This seems to work fine. It doesn't pass "d:\somedir\<test[YMD]" to the editor.

And regardless of how you currently implemented this, don't you agree that you should never pass "d:\somedir\<test[Q]" to the editor?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 52921
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"

Post by *ghisler(Author) »

It does not check for errors - the user will get the error when the file couldn't be opened. How is that worse than just showing <Error!>?
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 6888
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"

Post by *white »

ghisler(Author) wrote: 2026-05-10, 08:01 UTC It does not check for errors - the user will get the error when the file couldn't be opened. How is that worse than just showing <Error!>?
"d:\somedir\<test[Q]" is clearly not a valid filename, and it is unknown how the user's editor will handle that. Not starting the editor or starting the editor without a filename would be better than sending that.
User avatar
white
Power Member
Power Member
Posts: 6888
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"

Post by *white »

11.05.26 Fixed: cm_Edit with invalid name parameter, e.g. /GN="<test[Q]" now shows an error instead of opening the file (32/64)
Tested OK with TC 11.57a pre1 32-bit and 64bit. Error shown: "Invalid file name specified!" (followed by the name specification)

Including the "G" in the example (/GN="<test[Q]") is redundant and may be confusing.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 52921
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"

Post by *ghisler(Author) »

You are right, I will remove the G from the history entry.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 52921
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"

Post by *ghisler(Author) »

Please re-check with Total Commander 11.57a RC1!
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 6888
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC 11.57] Faulty filename passed to editor by cm_Edit command, e.g. cm_Edit /N="<abc[Q]"

Post by *white »

Tested OK using TC 11.57a rc1 32-bit and 64-bit.

Moderator message from: white » 2026-05-20, 14:17 UTC

Moved topic
» from TC11.x bug reports (English) to TC Fixed bugs
Post Reply