<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.26.0">
</HEAD>
<BODY>
On Sun, 2010-11-28 at 19:58 +0100, Roland Mainz wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
On Sun, Nov 28, 2010 at 7:47 PM, Gaetan Nadon <<A HREF="mailto:memsize@videotron.ca">memsize@videotron.ca</A>> wrote:
> On Sun, 2010-11-28 at 15:47 +0100, Jan Engelhardt wrote:
>
> Signed-off-by: Jan Engelhardt <<A HREF="mailto:jengelh@medozas.de">jengelh@medozas.de</A>>
> ---
>  autogen.sh |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/autogen.sh b/autogen.sh
> index 904cd67..90d2520 100755
> --- a/autogen.sh
> +++ b/autogen.sh
> @@ -1,12 +1,12 @@
>  #! /bin/sh
>
> -srcdir=`dirname $0`
> +srcdir=`dirname "$0"`
>  test -z "$srcdir" && srcdir=.
>
>  ORIGDIR=`pwd`
> -cd $srcdir
> +cd "$srcdir"
>
>  autoreconf -v --install || exit 1
> -cd $ORIGDIR || exit $?
> +cd "$ORIGDIR" || exit $?
>
> -$srcdir/configure --enable-maintainer-mode "$@"
> +exec "$srcdir/configure" --enable-maintainer-mode "$@"
>
> I am not expert in quoting, can you explain how this is more appropriate?
> If it is, then all other autogen.sh should be changed as well.
> I am always looking for improvement.

Without double-quotes an variable expansion (e.g. ${var}) is subject
to field splitting (for each character listed in the variable IFS -
which by default contains <space>, <tab>, <newline>).
Example (note that "sh" is expected to be a POSIX sh-like shell):
Without double-quotes the "printf" utility will see the value "foo
bar" as two arguments (note that printf(1) will repeatedly use the
format until all arguments have been used-up):
-- snip --
$ sh -c 'x="foo bar" ; printf "|%s|\n" $x'
|foo|
|bar|
-- snip --
With double-quotes it will print:
-- snip --
$ sh -c 'x="foo bar" ; printf "|%s|\n" "$x"'
|foo bar|
-- snip --

It's usually recommended to use double-quotes unless field splitting
is really wanted (or set IFS='' to disable field-splitting).

</PRE>
</BLOCKQUOTE>
Thanks. I tried to run autogen.sh on a module installed in a source directory containing a space<BR>
and it failed.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
----

Bye,
Roland

</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>