Properly return error codes for errors in ifs in mumble-win*.cmd #43

Merged
merged 1 commit into from Feb 11, 2017

Projects

None yet

2 participants

@hacst
Member
hacst commented Feb 11, 2017

Turns out everything in a if "branch" gets expanded by cmd as soon as the
branch is entered. This means that if errorlevel gets changed in during the
branch because our conditional command failed the following exit call already
had its error code expanded to 0. We can work around this by either using
delayed expansion on the errorlevel in these branches or by checking for errors
after the branches. This patch implements the latter variant. Mostly because we
can (as soon as we have to calls in the branch delayed expansion would be the
only way to go) and because it the impact is smaller at this point. Might switch
over later.

@hacst hacst Properly return error codes for errors in ifs in mumble-win*.cmd
Turns out everything in a if "branch" gets expanded by cmd as soon as the
branch is entered. This means that if errorlevel gets changed in during the
branch because our conditional command failed the following exit call already
had its error code expanded to 0. We can work around this by either using
delayed expansion on the errorlevel in these branches or by checking for errors
after the branches. This patch implements the latter variant. Mostly because we
can (as soon as we have to calls in the branch delayed expansion would be the
only way to go) and because it the impact is smaller at this point. Might switch
over later.
557adba
@hacst hacst requested a review from mkrautz Feb 11, 2017
@mkrautz mkrautz merged commit c0886a0 into mumble-voip:master Feb 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment