qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] configure: replace \n with space in optarg
@ 2014-08-04  7:12 Hu Tao
  2014-08-04  8:50 ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Hu Tao @ 2014-08-04  7:12 UTC (permalink / raw)
  To: qemu-devel

When optarg happens to contain \n like:

../configure --target-list='i386-softmmu
 x86_64-softmmu'

make will fail with message:

config-host.mak:45: *** missing separator.  Stop.

This patch fix this problem by replacing \n with space in optarg.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
---
 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index f7685b5..0ee9de1 100755
--- a/configure
+++ b/configure
@@ -338,7 +338,7 @@ numa=""
 
 # parse CC options first
 for opt do
-  optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
+  optarg=`expr "x$opt" : 'x[^=]*=\(.*\)' | tr '\n' ' '`
   case "$opt" in
   --cross-prefix=*) cross_prefix="$optarg"
   ;;
@@ -722,7 +722,7 @@ fi
 werror=""
 
 for opt do
-  optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
+  optarg=`expr "x$opt" : 'x[^=]*=\(.*\)' | tr '\n' ' '`
   case "$opt" in
   --help|-h) show_help=yes
   ;;
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: replace \n with space in optarg
  2014-08-04  7:12 [Qemu-devel] [PATCH] configure: replace \n with space in optarg Hu Tao
@ 2014-08-04  8:50 ` Peter Maydell
  2014-08-04  9:29   ` Hu Tao
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2014-08-04  8:50 UTC (permalink / raw)
  To: Hu Tao; +Cc: QEMU Developers

On 4 August 2014 08:12, Hu Tao <hutao@cn.fujitsu.com> wrote:
> When optarg happens to contain \n like:
>
> ../configure --target-list='i386-softmmu
>  x86_64-softmmu'
>
> make will fail with message:
>
> config-host.mak:45: *** missing separator.  Stop.

Why would you put newlines in the option string? This is
likely to break for many configure arguments, not just this
one...

I'm a bit dubious about taking this change unless you can
point to existing practice (eg do autoconf configure scripts
clean up whitespace like this?)

thanks
-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: replace \n with space in optarg
  2014-08-04  8:50 ` Peter Maydell
@ 2014-08-04  9:29   ` Hu Tao
  0 siblings, 0 replies; 3+ messages in thread
From: Hu Tao @ 2014-08-04  9:29 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

On Mon, Aug 04, 2014 at 09:50:20AM +0100, Peter Maydell wrote:
> On 4 August 2014 08:12, Hu Tao <hutao@cn.fujitsu.com> wrote:
> > When optarg happens to contain \n like:
> >
> > ../configure --target-list='i386-softmmu
> >  x86_64-softmmu'
> >
> > make will fail with message:
> >
> > config-host.mak:45: *** missing separator.  Stop.
> 
> Why would you put newlines in the option string? This is
> likely to break for many configure arguments, not just this
> one...

It is not intended but once when I did copy&paste the string it brought a
\n.

> 
> I'm a bit dubious about taking this change unless you can
> point to existing practice (eg do autoconf configure scripts
> clean up whitespace like this?)

I doubt there is.

> 
> thanks
> -- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-04  9:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-04  7:12 [Qemu-devel] [PATCH] configure: replace \n with space in optarg Hu Tao
2014-08-04  8:50 ` Peter Maydell
2014-08-04  9:29   ` Hu Tao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).