autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 10/10] * tests/torture.at (srcdir): Fix quoting.


From: Ralf Wildenhues
Subject: Re: [PATCH 10/10] * tests/torture.at (srcdir): Fix quoting.
Date: Sat, 8 Dec 2007 10:17:29 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hi Jim,

* Jim Meyering wrote on Fri, Dec 07, 2007 at 08:49:25AM CET:
> Ralf Wildenhues <address@hidden> wrote:
[...]
> > --- a/tests/torture.at
> > +++ b/tests/torture.at
> > @@ -973,9 +973,9 @@ AT_DATA([configure.ac],
> >  AC_CONFIG_FILES([foo at-dir/bar])
> >
> >  AC_CONFIG_COMMANDS([report],
> > -[test -f $srcdir/configure.ac ||
> > +[test -f "$srcdir/configure.ac" ||
> >     AC_MSG_ERROR([cannot find $srcdir/configure.ac])],
> > -              [srcdir=$srcdir])
> > +              [srcdir='$srcdir'])
[...]
> At first, I thought using single quotes here might be a mistake.
> Of course, once I looked at a generated configure script, it
> makes sense: that's part of an unquoted here document.
> 
> How about adding a comment like this?

Thanks, will apply as below (for looks, I used # comments rather than
d@&address@hidden escaped ones).

Cheers,
Ralf

diff --git a/tests/torture.at b/tests/torture.at
index 11c619d..6a7b962 100644
--- a/tests/torture.at
+++ b/tests/torture.at
@@ -972,10 +972,13 @@ AT_DATA([configure.ac],
 
 AC_CONFIG_FILES([foo at-dir/bar])
 
+# Use quotes in the INIT-COMMANDS to accommodate a value of $srcdir
+# containing e.g., spaces or shell meta-characters.
+# Use *single* quotes because the context is an unquoted here-doc.
 AC_CONFIG_COMMANDS([report],
-[test -f $srcdir/configure.ac ||
+[test -f "$srcdir/configure.ac" ||
    AC_MSG_ERROR([cannot find $srcdir/configure.ac])],
-                  [srcdir=$srcdir])
+                  [srcdir='$srcdir'])
 
 AC_OUTPUT
 rm -f -r foo at-dir/bar




reply via email to

[Prev in Thread] Current Thread [Next in Thread]