On 06/29/2010 12:35 PM, Ralf Wildenhues wrote:
> * Gary V. Vaughan wrote on Tue, Jun 29, 2010 at 08:30:43PM CEST:
>> On 30 Jun 2010, at 01:22, Ralf Wildenhues wrote:
>>> I think m4sh can simply use code like
>>>
>>> if ( eval '$smart_works' ) >/dev/null 2>&1; then
>>>func_foo () { smart code;
* Gary V. Vaughan wrote on Tue, Jun 29, 2010 at 08:30:43PM CEST:
> On 30 Jun 2010, at 01:22, Ralf Wildenhues wrote:
> > I think m4sh can simply use code like
> >
> > if ( eval '$smart_works' ) >/dev/null 2>&1; then
> >func_foo () { smart code; }
> > else
> >func_foo () { safe code; }
> >
Hallo Ralf,
On 30 Jun 2010, at 01:22, Ralf Wildenhues wrote:
> * Gary V. Vaughan wrote on Tue, Jun 29, 2010 at 05:09:29PM CEST:
>> On 29 Jun 2010, at 21:03, Eric Blake wrote:
>>> Ultimately, I'd like to fix m4sh to make it easier to probe/require XSI
>>> support, but that will have to wait until a
Hi Gary,
* Gary V. Vaughan wrote on Tue, Jun 29, 2010 at 05:09:29PM CEST:
> On 29 Jun 2010, at 21:03, Eric Blake wrote:
> > Ultimately, I'd like to fix m4sh to make it easier to probe/require XSI
> > support, but that will have to wait until after autoconf 2.66.
>
> While that might turn out to b
Hi Eric,
On 29 Jun 2010, at 21:03, Eric Blake wrote:
> On 06/29/2010 12:52 AM, Gary V. Vaughan wrote:
> i=$((i+1))
>>
>> I think we can't rely on the availability of $((expr)) :(
>
> Is there any shell that supports XSI but not $(()), seeing as how both
> are mandated by POSIX? But we've al
On 06/29/2010 12:52 AM, Gary V. Vaughan wrote:
i=$((i+1))
>
> I think we can't rely on the availability of $((expr)) :(
Is there any shell that supports XSI but not $(()), seeing as how both
are mandated by POSIX? But we've already come up with better
alternatives, so this is a moot point.
Hi Paolo,
On 29 Jun 2010, at 15:21, Paolo Bonzini wrote:
> On 06/29/2010 08:52 AM, Gary V. Vaughan wrote:
>> func_split_short_arg ()
>> {
>> arg="$1"; while test ${#arg} -gt 2; do arg="${arg%?}"; done
>> rest=${1%??}
>> }
>
> What about
>
> func_split_short_arg () {
> rest=${1#??};
> arg=$
On 06/29/2010 08:52 AM, Gary V. Vaughan wrote:
Well, really the problem is this:
while $# -gt 0; do
opt=$1; shift
case $opt in
-p) opt_p="$1"; shift ;;
-q) opt_q="$1"; shift ;;
-x) opt_x=: ;;
-y) opt_y=: ;;
-p*|-q*) # option args
func_split_short_arg $opt
Hi Eric,
Thanks for the feedback!
On 29 Jun 2010, at 05:37, Eric Blake wrote:
> On 06/28/2010 04:19 PM, Ralf Wildenhues wrote:
>> * Eric Blake wrote on Mon, Jun 28, 2010 at 02:49:40PM CEST:
>>> tmp=${1#?}
>>> patt=
>>> i=2
>>> while test $i -lt ${#1}; do
>>> patt="?$patt"
>>
>> If the parameter
On 06/28/2010 04:19 PM, Ralf Wildenhues wrote:
> Hi Eric,
>
> thanks for the suggestion. I had considered the idea for a second, but
> failed to see the nontrivial half.
>
> * Eric Blake wrote on Mon, Jun 28, 2010 at 02:49:40PM CEST:
>> tmp=${1#?}
>> patt=
>> i=2
>> while test $i -lt ${#1}; do
>
Hi Eric,
thanks for the suggestion. I had considered the idea for a second, but
failed to see the nontrivial half.
* Eric Blake wrote on Mon, Jun 28, 2010 at 02:49:40PM CEST:
> tmp=${1#?}
> patt=
> i=2
> while test $i -lt ${#1}; do
> patt="?$patt"
If the parameter may be expected to be very l
ash-isms as:
tmp=${1#?}
patt=
i=2
while test $i -lt ${#1}; do
patt="?$patt"
i=$((i+1))
done
result=${tmp%$patt}
Obviously, you'd want to pick better variable names due to namespace
considerations...
--
View this message in context:
http://old.nabble.com/-PATCH--
Hallo Ralf,
Thanks for the review.
On 27 Jun 2010, at 19:02, Ralf Wildenhues wrote:
> * Gary V. Vaughan wrote on Sun, Jun 27, 2010 at 12:58:03PM CEST:
>> Okay to push?
>
> No, ${parameter:offset} and ${parameter:offset:length} are bash specific
> not XSI mandated.
Ah, okay. Didn't think to loo
* Gary V. Vaughan wrote on Sun, Jun 27, 2010 at 12:58:03PM CEST:
> Okay to push?
No, ${parameter:offset} and ${parameter:offset:length} are bash specific
not XSI mandated. IIRC we already have a separate test for bash
features that won't regress on non-bash XSI shells. Please add the test
there.
Okay to push?
* libltdl/m4/libtool.m4 (_LT_CHECK_SHELL_FEATURES): Also ensure
that XSI substring extraction is supported.
(_LT_PROG_XSI_SHELLFNS): Use XSI substring extraction to split
short options to avoid unnecessary forks if the host shell
supports that.
---
ChangeLog |7 +
15 matches
Mail list logo