Stepan Kasal <[EMAIL PROTECTED]> writes:
> 2005-08-24 Stepan Kasal <[EMAIL PROTECTED]>
>
> * lib/autoconf/general.m4 (_AC_CANONICAL_SPLIT): Simplify; rejecting
> some evil values and relying on the fact that $* concatenates the
> parameters by the first character from IFS.
That looks good; please install.
One other issue comes to mind, though, and this is one that occurs
elsewhere in Autoconf-generated shell scripts. A command like this:
set x $something; shift
normally has undesirable behavior if "$something" is subjected to
file name expansion. For example:
touch a b c
something='*-*'
ac_save_IFS=$IFS;
IFS='-'
set x $something; shift
IFS=$ac_save_IFS
echo $@
outputs "a b c a b c", which is not what is usually wanted.
POSIX says that you're supposed to work around it using 'set -f'.
Perhaps we should do something like the following, suitably
packaged up for Autoconf?
if (set -f) 2>/dev/null; then
ac_do_noglob='set -f'
ac_do_glob='set +f'
else
ac_do_noglob=
ac_do_glob=
fi
ac_save_IFS=$IFS
IFS='-'
$ac_do_noglob
set x $something; shift
$ac_do_glob
IFS=$ac_save_IFS
This should be done almost everywhere that there is a 'set' command
with args. Perhaps m4sh needs an AS_SET_UNEXPANDED_ARGS macro, or
something like that, to do the above.