TCC/CMD difference

Jun 2, 2008
37
0
Denmark
Hi

I have discovered this difference while running the flutter.bat file provided by Google:
Code:
REM Test if Git is available on the Host
where /q git || ECHO Error: Unable to find git in your PATH. && EXIT /B 1
In CMD, if the first command succeeds, nothing happens. If it fails, a message is shown and the script is terminated. In TCC, if the first command succeeds, no message is shown but the script is still terminated. So it seems that CMD and TCC do not quite agree on operator precedence here.

A well-placed set of parentheses solves this:
Code:
REM Test if Git is available on the Host
where /q git || (ECHO Error: Unable to find git in your PATH. && EXIT /B 1)
but this correction will have to be made every time Google updates this file.

- Ebbe