open-watcom/open-watcom-v2 — pull request #100 by ArmstrongJ (2014-10-07 13:53:21+00:00)
Title: Minor fixes for wlib's "ar" compatibility mode

This pull request fixes two issues encountered with wlib's AR mode. Specifically:

1. Switching to AR mode, aside from renaming wlib, relies on WLIB$AR being defined as an environment variable. However, **WLIB$AR** is not a valid environment variable in bash, which can be a major problem on GNU/Linux. I've added **WLIB_AR** as another environment variable to trigger AR mode. **WLIB$AR** remains present for compatibility.

2. AR mode did not seem to work anyways. For example, the following command would fail:

`ar -r -c libcollection.a objs/first.o`

Wlib would fail with the above command with "Error! Invalid option '-l'" because wlib is mishandling the *operation*s specified in the command line. Specifically, it was parsing each argument of the command line individually, and the *operation* set by each argument did not persist to the next argument parse call. Because the *operation* did not persist, the parser incorrectly treats the argument "libcollection.a" as yet another option.