Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrent errorlevel reported while exiting a console #373

Closed
palvaradomoya opened this issue Jan 6, 2016 · 2 comments
Closed

Incorrent errorlevel reported while exiting a console #373

palvaradomoya opened this issue Jan 6, 2016 · 2 comments

Comments

@palvaradomoya
Copy link

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

@mridgers
Copy link
Owner

Thanks for the report @palvaradomoya, the example Batch script was very helpful. I'd be grateful if you could try the build here which should fix your problem (if you added the autorun entry yourself you will need to refresh it).

mridgers added a commit that referenced this issue Jan 11, 2016
@palvaradomoya
Copy link
Author

It works! Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants