Bash-4.1 distribution source
[platform/upstream/bash.git] / builtins / declare.def
index bd7d6b6..a0ce605 100644 (file)
@@ -503,14 +503,19 @@ declare_internal (list, local_var)
            assign_array_var_from_string (var, value, aflags);
          else if (simple_array_assign && subscript_start)
            {
-             /* declare [-a] name[N]=value */
+             /* declare [-aA] name[N]=value */
              *subscript_start = '[';   /* ] */
              var = assign_array_element (name, value, 0);      /* XXX - not aflags */
              *subscript_start = '\0';
            }
          else if (simple_array_assign)
-           /* let bind_array_variable take care of this. */
-           bind_array_variable (name, 0, value, aflags);
+           {
+             /* let bind_{array,assoc}_variable take care of this. */
+             if (assoc_p (var))
+               bind_assoc_variable (var, name, "0", value, aflags);
+             else
+               bind_array_variable (name, 0, value, aflags);
+           }
          else
 #endif
          /* bind_variable_value duplicates the essential internals of