[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: improved Automake test for file names with funny characters
From: |
Stepan Kasal |
Subject: |
Re: improved Automake test for file names with funny characters |
Date: |
Wed, 7 Sep 2005 12:52:40 +0200 |
User-agent: |
Mutt/1.4.1i |
Hello,
On Tue, Sep 06, 2005 at 12:16:31PM -0700, Paul Eggert wrote:
> Alexandre Duret-Lutz <address@hidden> writes:
> > Does Stepan's patch for quoting $@ before eval look right to you?
>
> No, because echo mishandles some path names. [...]
and what about this:
d=`sed "s,','\\\\\\\\'',g;s,/,' ',g;s,^,',;s,\\\$,'," <ACEOF
$dstdir
ACEOF
`
of course, it strips trailing whitespace.
Do you see any other problem?
The main reason of this question is that I'm curious.
But if you cannot see any problem, we could have an ultra-portable version:
oIFS=$IFS
case $posix_glob,$dstdir in
true,*) oIFS=$IFS; IFS=/; set -f; set x $dstdir; shift; set +f; IFS=$oIFS;;
*[\*\?\[]* | *\]*)
d=`sed "s,','\\\\\\\\'',g;s,/,' ',g;s,^,',;s,$,'," <EOF
$dstdir
EOF
`
eval set "$d"
;;
*) oIFS=$IFS; IFS=/; set x $dstdir; shift; IFS=$oIFS;;
esac
And something similar for the m4sh macro we discussed on the autoconf-patches
list.
Do you think it would be worth it?
Stepan Kasal