Skip to content

Incorrent errorlevel reported while exiting a console #373

@palvaradomoya

Description

@palvaradomoya

Hello all,

first than all, thanks a lot for the great tool!

Since moving from version 0.4.5 to version 0.4.6 some bug is hindering the proper error report from nested batch processes. This happens when Clink is configured to start automatically, because the errorlevel received by a calling process differs from the real errorlevel reported by the batch script (without Clink).

This affects for instance any postbuild scripts used with Visual Studio 2008 . After installing Clink 0.4.6 CMake stopped configuring any project for this compiler, because all postbuild steps report the wrong error level, and CMake use them to detect compilers, compiler flags, etc.

Even a simple "@echo "foo" as a postbuild step fails in visual studio 2008, reporting always an incorrect errorlevel. With the version 0.4.5 of Clink everything works as expected.

To reproduce the problem, copy the following lines into "test.bat" and execute in a cmd:

 @echo off
 if NOT "%1"=="1" (
   call test.bat 1 
   if errorlevel==1 ( 
     echo "Error" 
   ) else ( 
     echo "Ok" 
   )
 ) else (
  set foo="bar"
 )

In Clink 0.4.5 it outputs "Ok" but in Clink 0.4.6 it outputs "Error"

Regards,

Pablo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions