Burkhard M reported this to me via email, and I am adding my own additional info:
FreeCOM 0.85 does not track IF ERRORLEVEL correctly. I haven't looked through the code yet, but it seems as though FreeCOM 0.85 is treating IF ERROLEVEL like the return code was zero. (But the behavior is correct in 0.84 releases.)
The ERRORLEVEL environment variable is getting set correctly.
Additional debugging info - I wrote this simple program to set the ERRORLEVEL to a predictable value:
And this T.BAT file:
And this T2.BAT:
Calling "T 1" correctly prints "One" in the old versions of FreeCOM. But prints "Zero" in all builds of FreeCOM 0.85
Calling "T2 3" correctly prints "3" in all builds, old and new.
I will look into the issue and try to get a fix this week. I will test but do you know off hand which if 0.84 pre 7 worked correctly? or did it break in an earlier pre release?
It works correctly in 0.84-pre7
Running "T 3" prints "Three" in 0.84-pre7
Running "T2 4" prints "4" in 0.84-pre7
fixed with commit https://github.com/FDOS/freecom/commit/217812640954ec31224a69e288ddaa5bb2e80149
I will post a 0.85a release in a few days that includes it along with some documentation updates.
I added a version of your test batch file (errlvl.bat), the program to explicitly generate errorlevels (errlvl.c) already existed in the tests directory - to avoid any future regressions and test the fix see the errlvl.bat file added
This is resolved in 0.85a release. Please close bug.
Thanks! Marked as closed