On Sat, Jan 14, 2023 at 09:37:03PM +0100, Bruno Haible wrote:
> Eric Blake wrote:
> > Instead of using -- to force sh to realize the command being passed is
> > intended to be a script to run (even if it starts with - or +), it is
> > also possible to prepend a space.
> 
> Indeed, that it simpler than testing whether the command starts with - or +.
> 
> > I'm thinking of trying the alternative of not injecting "--" after
> > all, but instead munging the given argument to supply a leading space.
> > But that we need a new version of your patch.  Do you want to try and
> > rework it along those lines, or should I make time for that?
> 
> Find attached a proposed patch. Tested on FreeBSD 13.1 and AIX 7.2; with
> it, all m4 tests pass.
> 
> Bruno
> 

> From e09b3ff04cbfce7073de5c7fd3812ffe9c48bac3 Mon Sep 17 00:00:00 2001
> From: Bruno Haible <br...@clisp.org>
> Date: Sat, 14 Jan 2023 20:41:15 +0100
> Subject: [PATCH] syscmd: Make it work again for most commands on FreeBSD and
>  AIX.
> 
> Regression from 2021-11-19. Fix proposed by Eric Blake.
> 
> * src/builtin.c (m4_syscmd): On Unix, prepend a space to the command before
> executing it.
> (m4_esyscmd): Likewise.
> ---
>  src/builtin.c | 38 ++++++++++++++++++++++++++++++--------
>  1 file changed, 30 insertions(+), 8 deletions(-)

Thanks; applied.

Later, you asked:

> May I just push this patch? I have commit rights on the GNU m4 repository.
> 
> Yesterday, I attempted to test the latest GNU autoconf pre-release on FreeBSD,
> and encountered this bug again. It costs me time if such bugs are not fixed
> upstream.

I do not mind you making obvious commits like this, especially when
I'm having problems being reponsive.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org


Reply via email to