From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [musl] [PATCH 2/2] configure: improve portability of test command
Date: Sat, 10 Oct 2020 20:08:48 -0400 [thread overview]
Message-ID: <20201011000848.GD17637@brightrain.aerifal.cx> (raw)
In-Reply-To: <20201010185110.748-2-issam.e.maghni@mailbox.org>
On Sat, Oct 10, 2020 at 06:51:10PM +0000, Issam E. Maghni wrote:
> > The two commands:
> > test "$1"
> > test ! "$1"
> > could not be used reliably on some historical systems. Unexpected results
> > would occur if such a string expression were used and $1 expanded to '!', '(',
> > or a known unary primary. Better constructs are:
> > test -n "$1"
> > test -z "$1"
> > respectively.
> > Historical systems have also been unreliable given the common construct:
> > test "$response" = "expected string"
> > One of the following is a more reliable form:
> > test "X$response" = "Xexpected string"
> > test "expected string" = "$response"
> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html#tag_20_128_16
The text you've quoted is about non-conforming, pre-POSIX systems. Is
there an actual system where you're encoutering this problem? It's
always been the intent to assume a POSIX-conforming shell and
utilities for configure, and to require the user to upgrade to one if
they don't have one, because supporting non-conforming shell/utilities
is an endless game of whack-a-mole.
Rich
next prev parent reply other threads:[~2020-10-11 0:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-10 18:51 [musl] [PATCH 1/2] configure: do not use obsolescent form of test -a|o Issam E. Maghni
2020-10-10 18:51 ` [musl] [PATCH 2/2] configure: improve portability of test command Issam E. Maghni
2020-10-11 0:08 ` Rich Felker [this message]
2020-10-11 16:58 ` Issam E. Maghni
2020-10-11 0:14 ` [musl] [PATCH 1/2] configure: do not use obsolescent form of test -a|o Rich Felker
2020-10-11 16:46 ` Issam E. Maghni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201011000848.GD17637@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).