Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Zsh 3 and ${1+"$@"} (Was: [GNU Autoconf 2.53] testsuite.log: 126 failures)



Hi!

We (Autoconf) have a big problem with Zsh 3.0.8.  You know it is
shipped on Darwin as /bin/sh.  But this version does not understand
${1+"$@"} properly.  We use this instead of "$@" to work around a bug
which still exists today in many many constructors' /bin/sh, so we
can't departure from it.

But then, I have no choice than systematically rejecting /bin/sh if it
turns out to be zsh 3.  Unless there is some magic that can make
${1+"$@"} work properly?  Thanks!

Subject: Topics

Topics:
   Re: [GNU Autoconf 2.53] testsuite.log: 126 failures
   Re: [GNU Autoconf 2.53] testsuite.log: 126 failures 

--- Begin Message ---
| [ I've got an attachment, so I had to send this a little differently. -ab ]
| > Oh, I forgot to ask...  Please, not only should you run ./testsuite 3,
| 
| Attached testsuite.log.
| 
| > but also the same as before:
| >
| > | >         cd testsuite.dir/003
| > | >         PATH=../..:$PATH autoconf -d -v -f -t 'TRACE1:
| > | >         Hello world!'
| 
| This gives: 
| 
| |ARG: {--include}
| |ARG: {/Users/ab/Desktop/autoconf-2.53/lib}
| |ARG: {-d}
| |ARG: {-v}
| |ARG: {-f}
| |ARG: {-t}
| |ARG: {TRACE1:}
| |ARG: {Hello}
| |ARG: {world!}

It's already broken at this point!

Grrr.  What the heck is happening with your system :(

Please, try to run this shell-script:

#! /bin/sh

set dummy 'arg1' 'arg 2' 'arg
3'

echo "1."
for i in "$@"
do
  echo "{$i}"
done

echo "2."
for i in ${1+"$@"}
do
  echo "{$i}"
done

set ${1+"$@"}

echo "3."
for i in "$@"
do
  echo "{$i}"
done
Just run it with your /bin/sh (which should be zsh).  Thanks!

--- End Message ---
--- Begin Message ---
In message <mv4lmby38h7.fsf@xxxxxxxxxxxxxxxxxxxxxx>, Akim Demaille writes:
> 
> It's already broken at this point!
> 
> Grrr.  What the heck is happening with your system :(

This (z)sh is weird, I'm telling you.

> Please, try to run this shell-script:

OK, here's the result from /bin/sh (zsh 3.0.8)

	1.
	{dummy}
	{arg1}
	{arg 2}
	{arg
	3}
	2.
	{dummy}
	{arg1}
	{arg}
	{2}
	{arg}
	{3}
	3.
	{dummy}
	{arg1}
	{arg}
	{2}
	{arg}
	{3}

The newer zsh (4.0.4) and bash both give:

	1.
	{dummy}
	{arg1}
	{arg 2}
	{arg
	3}
	2.
	{dummy}
	{arg1}
	{arg 2}
	{arg
	3}
	3.
	{dummy}
	{arg1}
	{arg 2}
	{arg
	3}

ab



--- End Message ---


Messages sorted by: Reverse Date, Date, Thread, Author