bug-bash
[Top][All Lists]
Advanced

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

Re: param expansion with single-character special vars in the environmen


From: Grisha Levit
Subject: Re: param expansion with single-character special vars in the environment
Date: Sat, 14 May 2016 12:16:26 -0400

One more case, which currently segfaults:

declare -n REPLY; read <<< /

easy fix:

diff --git a/builtins/read.def b/builtins/read.def
index 5e2348c..8f6bd2b 100644
--- a/builtins/read.def
+++ b/builtins/read.def
@@ -797,9 +797,11 @@ assign_vars:
        }
       else
        var = bind_variable ("REPLY", input_string, 0);
-      VUNSETATTR (var, att_invisible);
-      if (readonly_p (var) || noassign_p (var))
+
+      if (var == 0 || readonly_p (var) || noassign_p (var))
        retval = EXECUTION_FAILURE;
+      else
+        VUNSETATTR (var, att_invisible);

       xfree (input_string);
       return (retval);

On Fri, May 6, 2016 at 11:39 AM, Chet Ramey <address@hidden> wrote:
On 4/27/16 4:07 PM, Eduardo A. Bustamante López wrote:
> Here's the updated list of cases:

Thanks for the list of test cases; these were very helpful.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/


reply via email to

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