Welcome!

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

SignUp Now!

TCC 14.02.37 CMD Compatibility Loss?

May
62
0
Through TCC 14.02.36 I had been running a CMD batch file distributed with the Windows port of Git under TCC with no problems. After the upgrade to TCC 14.02.37, the batch file fails.

I believe that the failure is caused by a change (regression? ;)) in the support of the special syntax for compatibility with CMDs syntax for referencing batch file parameters and the control variable of the FOR command. The indicated lines in the following CMD batch file and the outputs illustrate the difference.

Code:
why.cmd
@for /f "delims=" %%I in ("%~dp0..") do @echo %%I
@for /f "delims=" %%I in ("%~dp0..") do @echo %%~fI    <==
 
Microsoft Windows XP [Version 5.1.2600]
C:\Documents and Settings\rchapman>why.cmd
C:\Documents and Settings\rchapman\..
C:\Documents and Settings    <--

TCC  14.02.36   Windows XP [Version 5.1.2600]
[C:\Documents and Settings\rchapman]why.cmd
C:\Documents and Settings\rchapman\..
C:\Documents and Settings    <--

TCC  14.02.37   Windows XP [Version 5.1.2600]
[C:\Documents and Settings\rchapman]why.cmd
C:\Documents and Settings\rchapman..
C:\Documents and Settings\rchapman..    <--

I know that this may be a pretty bizarre use of CMDs syntax and that the TCC variable functions offer a superior method of stripping the path but:
  1. I'm lazy and would like to use the CMD batch file as distributed :)
  2. If the change was intentional, I would like to know "why" for my education.
Thanks
 
My open source development tools use bash scripts for Linux and cmd scripts for Windows. Everything stopped working a couple of days ago. I thought I upgraded the tools and broken something. I finally switched back to cmd.exe and everything worked. I realized the scripts make heavy use of %p0. It's behavior just changed recently in TCC to not return a trailing '\'.
 
Back
Top
[FOX] Ultimate Translator
Translate