ALERT!! Error in Inn-CURRENT-20090412

Russ Allbery rra at stanford.edu
Sun Apr 12 20:07:18 UTC 2009


Julien ÉLIE <julien at trigofacile.com> writes:

> So if I have the following list:
>
>    param: [ one "it's me" "and a quote\"" ]
>
> does it give:
>
>    PARAM='"one" "it'\''s me" "and a quote\""'
>
> or something else?
>
> (We need to handle spaces in the general case -- not only overview fields.)

Yeah, that's what I'd do.  The shell has no hope of taking that back apart
again, but I think that's an acceptable loss.

> But what if /bin/sh does not exist?

Then we're on Windows, and lots of things aren't going to work.  :)

> They advise to use SHELL = @SHELL@ (as found out by autoconf) in:
>
>    http://www.gnu.org/software/hello/manual/autoconf/The-Make-Macro-SHELL.html

That would be fine.  It used to be that the only value it would ever
return was /bin/sh.

> Yes:
>
>    if (NeedShell(process, (const char **)argv, (const char **)ARRAY_END(argv))) {
>        argv[0] = SITEshell;
>        argv[1] = (char *) "-c";
>        argv[2] = process;
>        argv[3] = NULL;
>    }
>
>    /* Fork a child. */
>    i = Spawn(sp->Nice, pan[PIPE_READ], (int)fileno(Errlog),
>       (int)fileno(Errlog), argv);
>
> We could have put @SHELL@ too here.

We could, but I don't see much point.  /bin/sh is guaranteed to exist and
work for what we want to do here.

>> The more fundamental problem is that some systems (older Solaris) don't
>> have bash, and trying to find a shell that supports arrays may be
>> tricky.

> Too bad that Autoconf does not know how to find that :)

Current versions will find a functional shell for Autoconf's purposes, but
that only guarantees that you get shell functions, I think.  I doubt
Autoconf cares about arrays.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.



More information about the inn-workers mailing list