1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

TCC 14.02.37 CMD Compatibility Loss?

Discussion in 'Support' started by Bob Chapman, Sep 21, 2012.

  1. Bob Chapman

    Joined:
    May 31, 2008
    Messages:
    53
    Likes Received:
    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
     
  2. William Crispin

    Joined:
    Sep 21, 2012
    Messages:
    4
    Likes Received:
    0
    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 '\'.
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,726
    Likes Received:
    80
  4. Bob Chapman

    Joined:
    May 31, 2008
    Messages:
    53
    Likes Received:
    0
    Indeed! All software products should have this kind of support!! Thanks.
     
  5. William Crispin

    Joined:
    Sep 21, 2012
    Messages:
    4
    Likes Received:
    0
    Yep, works great again.
     

Share This Page