automake-patches
[Top][All Lists]
Advanced

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

Automake patch to work around Zsh bug


From: Paul Eggert
Subject: Automake patch to work around Zsh bug
Date: Fri, 19 Apr 2002 14:00:35 -0700 (PDT)

> From: Akim Demaille <address@hidden>
> Date: 18 Apr 2002 14:33:03 +0200
> 
> missing belongs to Automake.

OK, I scanned through Automake looking for instances of the
portability problem there, and installed the following patch.

2002-04-19  Paul Eggert  <address@hidden>

        Fix some problems when using "$@" when there might be zero
        positional arguments in cases where this matters.  Zsh doesn't
        support the workaround ${1+"$@"} that has been used by
        Automake since the Mon Dec 4 11:55:36 1995 change.  Zsh is
        used as /bin/sh in MacOS X, so this problem needs to be worked
        around.

        * aclocal.in: Use 'case' statement to work around problem.
        * automake.in: Likewise.
        * lib/ylwrap: Likewise.
        * lib/missing: No need for workaround, as the command is never
        invoked with zero arguments.
        * tests/ccnoco.test: Likewise.
        * missing: Update from lib/missing.

Index: aclocal.in
===================================================================
RCS file: /cvs/automake/automake/aclocal.in,v
retrieving revision 1.67
diff -p -u -r1.67 aclocal.in
--- aclocal.in  13 Apr 2002 21:26:34 -0000      1.67
+++ aclocal.in  19 Apr 2002 20:48:25 -0000
@@ -2,12 +2,12 @@
 # -*- perl -*-
 # @configure_input@
 
-eval 'exec @PERL@ -S $0 ${1+"$@"}'
+eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
     if 0;
 
 # aclocal - create aclocal.m4 by scanning configure.ac
 
-# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
 #           Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1291
diff -p -u -r1.1291 automake.in
--- automake.in 19 Apr 2002 10:21:30 -0000      1.1291
+++ automake.in 19 Apr 2002 20:48:27 -0000
@@ -2,11 +2,11 @@
 # -*- perl -*-
 # @configure_input@
 
-eval 'exec @PERL@ -S $0 ${1+"$@"}'
+eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
     if 0;
 
 # automake - create Makefile.in from Makefile.am
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
 # Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
Index: lib/missing
===================================================================
RCS file: /cvs/automake/automake/lib/missing,v
retrieving revision 1.20
diff -p -u -r1.20 missing
--- lib/missing 18 Jan 2002 21:12:54 -0000      1.20
+++ lib/missing 19 Apr 2002 20:48:29 -0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
-# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard <address@hidden>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -293,23 +293,23 @@ WARNING: \`$1' is missing on your system
     # Look for gnutar/gtar before invocation to avoid ugly error
     # messages.
     if (gnutar --version > /dev/null 2>&1); then
-       gnutar ${1+"$@"} && exit 0
+       gnutar "$@" && exit 0
     fi
     if (gtar --version > /dev/null 2>&1); then
-       gtar ${1+"$@"} && exit 0
+       gtar "$@" && exit 0
     fi
     firstarg="$1"
     if shift; then
        case "$firstarg" in
        *o*)
            firstarg=`echo "$firstarg" | sed s/o//`
-           tar "$firstarg" ${1+"$@"} && exit 0
+           tar "$firstarg" "$@" && exit 0
            ;;
        esac
        case "$firstarg" in
        *h*)
            firstarg=`echo "$firstarg" | sed s/h//`
-           tar "$firstarg" ${1+"$@"} && exit 0
+           tar "$firstarg" "$@" && exit 0
            ;;
        esac
     fi
Index: lib/ylwrap
===================================================================
RCS file: /cvs/automake/automake/lib/ylwrap,v
retrieving revision 1.20
diff -p -u -r1.20 ylwrap
--- lib/ylwrap  1 Nov 2001 17:39:39 -0000       1.20
+++ lib/ylwrap  19 Apr 2002 20:48:29 -0000
@@ -1,6 +1,9 @@
 #! /bin/sh
 # ylwrap - wrapper for lex/yacc invocations.
-# Copyright 1996, 1997, 1998, 1999, 2001  Free Software Foundation, Inc.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002 Free Software
+# Foundation, Inc.
+#
 # Written by Tom Tromey <address@hidden>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -71,7 +74,10 @@ mkdir $dirname || exit 1
 
 cd $dirname
 
-$prog ${1+"$@"} "$input"
+case $# in
+ 0) $prog "$input" ;;
+ *) $prog "$@" "$input" ;;
+esac
 status=$?
 
 if test $status -eq 0; then
Index: tests/ccnoco.test
===================================================================
RCS file: /cvs/automake/automake/tests/ccnoco.test,v
retrieving revision 1.4
diff -p -u -r1.4 ccnoco.test
--- tests/ccnoco.test   26 Dec 2001 08:22:05 -0000      1.4
+++ tests/ccnoco.test   19 Apr 2002 20:48:29 -0000
@@ -50,7 +50,7 @@ case "$@" in
     ;;
 esac
 
-exec gcc ${1+"$@"}
+exec gcc "$@"
 END
 
 chmod +x Mycomp



reply via email to

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