autoconf-patches
[Top][All Lists]
Advanced

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

spaces in $0


From: Ralf Wildenhues
Subject: spaces in $0
Date: Mon, 20 Mar 2006 08:34:54 +0100
User-agent: Mutt/1.5.11

This changes all usage of $0 (and thus $as_me and $as_myself) in
autoconf/lib/*/*.m4 to not mind white space.  OK to apply?

I've tested with the _AS_LINENO_PREPARE part with the OSF /usr/bin/sh
Bourne shell (which does not support LINENO).

Note that surely there may be other reasons that disallow spaces in $0
(for example Makefile rebuilding rules), but they are not in Autoconf.
And also note that the changes are contained in an execution path that
is rarely taken, so such usage may already happen without users actually
noticing this limitation.

Cheers,
Ralf

        * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Quote
        `$0' to protect against spaces.
        * lib/autotest/general.m4 (AT_INIT): Likewise.
        * lib/m4sugar/m4sh.m4 (_AS_LINENO_PREPARE): Likewise, for
        `$0', $as_me, $as_myself.

Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.86
diff -u -r1.86 status.m4
--- lib/autoconf/status.m4      6 Mar 2006 22:34:34 -0000       1.86
+++ lib/autoconf/status.m4      16 Mar 2006 20:48:19 -0000
@@ -1262,7 +1262,7 @@
   echo "running CONFIG_SHELL=$SHELL $SHELL $[0] " $ac_configure_args 
\$ac_configure_extra_args " --no-create --no-recursion" >&AS_MESSAGE_FD
   CONFIG_SHELL=$SHELL
   export CONFIG_SHELL
-  exec $SHELL $[0] $ac_configure_args \$ac_configure_extra_args --no-create 
--no-recursion
+  exec $SHELL "$[0]" $ac_configure_args \$ac_configure_extra_args --no-create 
--no-recursion
 fi
 m4_ifdef([_AC_OUTPUT_COMMANDS_INIT],
 [#
Index: lib/autotest/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autotest/general.m4,v
retrieving revision 1.198
diff -u -r1.198 general.m4
--- lib/autotest/general.m4     12 Mar 2006 19:58:31 -0000      1.198
+++ lib/autotest/general.m4     16 Mar 2006 20:48:19 -0000
@@ -940,17 +939,17 @@
     # Summary of failed and skipped tests.
     if test $at_fail_count != 0; then
       echo "Failed tests:"
-      $SHELL $[0] $at_fail_list --list
+      $SHELL "$[0]" $at_fail_list --list
       echo
     fi
     if test $at_skip_count != 0; then
       echo "Skipped tests:"
-      $SHELL $[0] $at_skip_list --list
+      $SHELL "$[0]" $at_skip_list --list
       echo
     fi
     if test $at_xpass_count != 0; then
       echo "Unexpected passes:"
-      $SHELL $[0] $at_xpass_list --list
+      $SHELL "$[0]" $at_xpass_list --list
       echo
     fi
     if test $at_fail_count != 0; then
Index: lib/m4sugar/m4sh.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.161
diff -u -r1.161 m4sh.m4
--- lib/m4sugar/m4sh.m4 14 Mar 2006 07:18:18 -0000      1.161
+++ lib/m4sugar/m4sh.m4 16 Mar 2006 20:48:19 -0000
@@ -805,7 +805,7 @@
   sed -n '
     p
     /[[$]]LINENO/=
-  ' <$as_myself |
+  ' <"$as_myself" |
     sed '
       s/[[$]]LINENO.*/&-/
       t lineno
@@ -816,14 +816,14 @@
       s/[[$]]LINENO\([[^'$as_cr_alnum'_]].*\n\)\(.*\)/\2\1\2/
       t loop
       s/-\n.*//
-    ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
+    ' >"$as_me.lineno" &&
+  chmod +x "$as_me.lineno" ||
     AS_ERROR([cannot create $as_me.lineno; rerun with a POSIX shell])
 
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
+  . "./$as_me.lineno"
   # Exit status is that of the last command.
   exit
 }




reply via email to

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