[TC 11.50b7] Environment variables are not expanded after returning from pseudo-variable $CLIP*

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Fla$her
Power Member
Power Member
Posts: 3015
Joined: 2020-01-18, 04:03 UTC

[TC 11.50b7] Environment variables are not expanded after returning from pseudo-variable $CLIP*

Post by *Fla$her »

1. Select %COMMANDER_PATH% and copy to clipboard.
2. Execute from the command line, button, etc. some of this:
  • cd %$CLIPBOARD%
  • cd %$CLIPNAME1%
  • Code: Select all

    TOTALCMD#BAR#DATA
    cd
    ?%|$CLIPBOARD0| %|$CLIPNAME1|
    wcmicon2.dll,45
    Check the variables
The result is negative.
Last edited by Fla$her on 2024-11-24, 10:06 UTC, edited 1 time in total.
Overquoting is evil! 👎
User avatar
AntonyD
Power Member
Power Member
Posts: 1661
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: [TC 11.50b7] Environment variables are not deployed after returning from pseudo-variable $CLIP*

Post by *AntonyD »

.
Last edited by AntonyD on 2024-11-25, 09:44 UTC, edited 1 time in total.
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.50b7] Environment variables are not expanded after returning from pseudo-variable $CLIP*

Post by *ghisler(Author) »

%$CLIPBOARD*% and %$CLIPNAME*% insert data from the clipboard as is. No environment variable substitution is done for the data from the clipboard. This is not a bug, other environment variables aren't resolved recursively either, this could lead to infinite loops, e.g. when the clipboard already contains %$CLIPBOARD%. That would be easy to detect, but it can be cyclic like this:
%$CLIPBOARD% -> clipboard contains %SOMEVAR% -> SOMEVAR contains %$CLIPBOARD%

Moderator message from: ghisler(Author) » 2024-11-25, 09:34 UTC

Moved to will not be changed.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 3015
Joined: 2020-01-18, 04:03 UTC

Re: [TC 11.50b7] Environment variables are not expanded after returning from pseudo-variable $CLIP*

Post by *Fla$her »

ghisler(Author) wrote: 2024-11-25, 09:34 UTC but it can be cyclic like this:
It's amazing to read! Why don't different scripts do this, but TC will suddenly do it?
Why do cyclic operations here, if you only expand the variable only once?
Is it possible to simply not use cyclic operations?
Overquoting is evil! 👎
Post Reply