automake-patches
[Top][All Lists]
Advanced

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

[PATCH] Work around a bug of AT&T Ksh w.r.t. ${1+"$@"}


From: Stefano Lattarini
Subject: [PATCH] Work around a bug of AT&T Ksh w.r.t. ${1+"$@"}
Date: Sun, 13 Dec 2009 18:51:06 +0100
User-agent: KMail/1.12.1 (Linux/2.6.30-2-686; KDE/4.3.2; i686; ; )

Work around a bug of AT&T Ksh w.r.t. ${1+"$@"}

* tests/defs.in (run_command): Don't use the expression
`${1+"$@"}', as it might trigger a bug of AT&T Korn shell.
From a9eaf3260332105be6fa23b6d25b59f5961424ba Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Sun, 13 Dec 2009 16:12:49 +0100
Subject: [PATCH 4/4] Work around a bug of AT&T Ksh w.r.t. ${1+"$@"}

* tests/defs.in (run_command): Don't use the expression
`${1+"$@"}', as it might trigger a bug of AT&T Korn shell.
---
 ChangeLog     |    6 ++++++
 tests/defs.in |   11 +++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2da4f22..fcc23b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-12-13  Stefano Lattarini  <address@hidden>
+
+       Work around a bug of AT&T Korn shell w.r.t. `${1+"$@"}'.
+       * tests/defs.in (run_command): Don't use the expression
+       `${1+"$@"}', as it might trigger a bug of AT&T Korn shell.
+
 2009-12-08  Stefano Lattarini  <address@hidden>
 
        Testsuite: remove AUTOMAKE_fails and AUTOMAKE_run
diff --git a/tests/defs.in b/tests/defs.in
index cf48981..8b48489 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -437,10 +437,17 @@ run_command ()
     0) echo "run_command: missing COMMAND argument" >&2; Exit 99;;
     *) run_cmd=$1; shift;;
   esac
+  # The use of `${1+"$@"}' might trigger a bug of some Korn shells
+  # if only one *empty* argument is given.
+  if test $# -eq 0; then
+    run_evald_cmd='"$run_cmd"'
+  else
+    run_evald_cmd='"$run_cmd" "$@"'
+  fi
   if test x"$run_mix_stdout_and_stderr" = x"yes"; then
-    run_evald_cmd='"$run_cmd" ${1+"$@"} >stdall 2>&1'
+    run_evald_cmd="$run_evald_cmd >stdall 2>&1"
   else
-    run_evald_cmd='"$run_cmd" ${1+"$@"} >stdout 2>stderr'
+    run_evald_cmd="$run_evald_cmd >stdout 2>stderr"
   fi
   # NOTE: do not use the apparently simpler construct:
   #   if eval "$run_evald_cmd"; then
-- 
1.6.5


reply via email to

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