fix problem with saving tty state after running a command with 'bind -x'; builtins that create associative arrays can now convert existing scalar variables to associative arrays

This commit is contained in:
Chet Ramey
2022-03-11 16:09:24 -05:00
parent b4e5e5505c
commit b6a567e7f1
10 changed files with 77 additions and 43 deletions
+2
View File
@@ -504,6 +504,8 @@ find_or_make_array_variable (name, flags)
report_error (_("%s: cannot convert indexed to associative array"), name);
return ((SHELL_VAR *)NULL);
}
else if (flags & 2)
var = assoc_p (var) ? var : convert_var_to_assoc (var);
else if (array_p (var) == 0 && assoc_p (var) == 0)
var = convert_var_to_array (var);