mzero/plush — pull request #27 by mzero (2013-02-03 22:39:43+00:00)
Title: Bug fixes - argv[0] and tabs

Now that we have if statements I discovered that the alternate form of the test command didn't work:

if [ -e README ]; then .... ; fi

This failed because the code wasn't passing the command name as `argv[0]` on exec. Instead it was passing the full path as found by path search. This was only discovered because the Mac OS X (and OpenBSD) version of [ acts like test unless `argv[0]` is exactly `[` (rather than `/bin/[`).

Turns out, the base libraries for doing exec (both `System.Process` and `System.Posix.Process`) have no way of passing in a separate `argv[0]` from the executable path. So... had to add that in `System.Posix.Missing`.

Also, while I was in there, I fixed the long standing issue with parsing tabs. _(Why?, you ask. Because now that I had profile loading, if statements, and tests working.... `/etc/profile` had lines that started with tabs, and that was failing!)