bison-patches
[Top][All Lists]
Advanced

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

examples: beware of shell portability issues


From: Akim Demaille
Subject: examples: beware of shell portability issues
Date: Sun, 2 Sep 2018 09:38:34 +0200

Installed in master.

commit 2d7e7438024e47650c3a0c9f5f313c6eb6acae2d
Author: Akim Demaille <address@hidden>
Date:   Sun Sep 2 09:20:06 2018 +0200

    examples: beware of shell portability issues
    
    Some shells don't grok `local var=$val` very well: they need the rhs
    to be quoted.
    
        ./examples/test: 66: local: you.,: bad variable name
        FAIL examples/variant.test (exit status: 2)
    
    Reported by √Čtienne Renault.
    
    * examples/test (run): Quote the values in 'local' assignments.

diff --git a/THANKS b/THANKS
index c655e3c6..7a69245f 100644
--- a/THANKS
+++ b/THANKS
@@ -51,6 +51,7 @@ Didier Godefroy           address@hidden
 Efi Fogel                 address@hidden
 Enrico Scholz             address@hidden
 Eric Blake                address@hidden
+√Čtienne Renault           address@hidden
 Evgeny Stambulchik        address@hidden
 Fabrice Bauzac            address@hidden
 Ferdinand Thiessen        address@hidden
diff --git a/examples/test b/examples/test
index a2439213..e4ffa259 100755
--- a/examples/test
+++ b/examples/test
@@ -60,10 +60,10 @@ cd $$.dir
 run ()
 {
   # Expected exit status.
-  local sta_exp=$1
+  local sta_exp="$1"
   shift
   # Expected output.
-  local out_exp=$1
+  local out_exp="$1"
   shift
   # Effective exit status.
   local sta_eff=0




reply via email to

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