Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Problem with broken alias

May
603
0
I accidentally ended up with a broken batch file that did this:
-------------- clip --------------
alias foo `%+ foo %&`
foo TEST
-------------- clip --------------

%& is "the rest of the command line"

When invoked, it eventually silently terminates the TCC window.

TCC 9.02.154
Module=C:\4NT9\TakeCmd.dll
Address=1008E054
Exception=C00000FD
EAX=0000005E EBX=100AE32C ECX=00000000 EDX=00989840
ESI=00000001 EDI=00000000 EBP=004470B0 ESP=00423000
CS=0000001B DS=00000023 ES=00000023 SS=00000023
Flags=00010202

Stack:
1 : TakeCmd.dll 0001:0008d054
2 : TakeCmd.dll 0001:00070452
3 : TakeCmd.dll 0001:0007532b


TCC 10.00.52
Module=C:\4NT\TakeCmd.dll
Address=1007D959
Exception=C00000FD
EAX=100AE254 EBX=100AF214 ECX=00000000 EDX=002B7850
ESI=002B9B5C EDI=019748BA EBP=000570A0 ESP=00033000
CS=0000001B DS=00000023 ES=00000023 SS=00000023
Flags=00010202

Stack:
1 : TakeCmd.dll 0001:0007c959
2 : TakeCmd.dll 0001:00066c9a


--
Jim Cook
2009 Saturdays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Sunday.
 
>I accidentally ended up with a broken batch file that did this:
> -------------- clip --------------
> alias foo `%+ foo %&`
> foo TEST
> -------------- clip --------------
>
> %& is "the rest of the command line"
>
> When invoked, it eventually silently terminates the TCC window.

I presume you've changed your parameter character?

Rex Conn
JP Software
 
Yes. I am using ^ for command separator and & for parameter and ctrl-x
for escape to be consistent with early 4dos batches we still run on
diskless dos boxes.

I meant to do two commands where the second one deleted files but in
my overzealous search and replace I also replaced the alias definition
itself with a call to the alias.

I know it is a recursive alias and is illegal and broken, but was
chagrined when the window vanished and took the history with it.

Sent from Cookie's iPhone
Jim Cook

On Feb 13, 2009, at 18:39, rconn <> wrote:


> ---Quote---
>> I accidentally ended up with a broken batch file that did this:
>> -------------- clip --------------
>> alias foo `%+ foo %&`
>> foo TEST
>> -------------- clip --------------
>>
>> %& is "the rest of the command line"
>>
>> When invoked, it eventually silently terminates the TCC window.
> ---End Quote---
> I presume you've changed your parameter character?
>
> Rex Conn
> JP Software
>
>
>
>
 
>I accidentally ended up with a broken batch file that did this:
> -------------- clip --------------
> alias foo `%+ foo %&`
> foo TEST
> -------------- clip --------------
>
> %& is "the rest of the command line"
>
> When invoked, it eventually silently terminates the TCC window.

TCC can detect alias loops or variable loops -- but what you've done is
embed an alias loop inside a variable loop, which is something that TCC
*can't* detect.

This is going to be difficult for the parser; I don't have an immediate fix
but I'll work on it.

Rex Conn
JP Software
 

Similar threads

Back
Top