On 04 Sep 2015, at 11:55, Thorsten Kukuk <kukuk(a)suse.de>
wrote:
On Fri, Sep 04, Tomas Mraz wrote:
> On Pá, 2015-09-04 at 12:36 +0300, Dmitry V. Levin wrote:
>> On Fri, Sep 04, 2015 at 08:36:46AM +0000, Tomáš Mráz wrote:
>> [...]
>>> - enable_docu=no
>>> + AC_PATH_PROG([BROWSER], [links])
>>> + if test ! -z "$BROWSER"; then
>>
>> test -n "$BROWSER"
>
> True :), I just copied the same test from the w3m test.
>
> Apparently in all the configure.ac source there is ! -z instead of -n.
> Do we want to replace all these occurrences? Do you have an idea why !
> -z was used instead of -n? Is there any shell where test -n does not
> work?
I'm not sure, but if I remember correct, there was a difference in
behavior if a variable does not exist or if it is empty.
But I couldn't find anything about this.
There is, but that’s already handled by using quotes. Without the quotes an empty
variables expands to nothing, while “$BROWSER” always expand to a (possible empty) string.
That guarantees test -n always has an argument to test.
Wichert.