On Tue, Sep 7, 2010 at 9:16 AM, Eric Blake <[email protected]> wrote: > Thanks for the report. However, I fail to see how getopt.m4 sets > POSIXLY_CORRECT in perpetuity, because it is immediately followed by > AS_UNSET if it was determined that POSIXLY_CORRECT was not set prior to the > test. While I appreciate the patch, I'd need more convincing why your patch > helps matters, and why the existing attempt at unsetting POSIXLY_CORRECT is > not working for you.
I explained in the first email: at the beginning of the macro, POSIXLY_CORRECT is set but not exported. As far as I can tell, this is the normal means of operation for bash when run as /bin/sh. The gnulib getopt macro then sees that POSIXLY_CORRECT is set and exports it. *That* is the bug. There's no portable way that I can see to "un-export" an environment variable, so I chose the alternate solution of not exporting it at all, and just setting the variable in the C program where it is required. Dustin -- Open Source Storage Engineer http://www.zmanda.com
