fixed a bug with expanding unquoted $* when the separator is not whitespace and one or more of the positional parameters ends with the separator, resulting in an extra blank field being generated; fixed an issue with adjusting SHLVL in subshells that caused the environment to be rebuilt too many times; fix to make sure function substitution doesn't leave the -v option unset

This commit is contained in:
Chet Ramey
2026-05-20 10:18:32 -04:00
parent 669b32f676
commit 2d4ba0c618
15 changed files with 503 additions and 36 deletions
+8 -5
View File
@@ -888,8 +888,8 @@ adjust_shell_level (int change)
new_level[3] = '\0';
}
temp_var = bind_variable ("SHLVL", new_level, 0);
set_auto_export (temp_var);
if (temp_var = bind_variable ("SHLVL", new_level, 0))
set_auto_export (temp_var);
}
static void
@@ -929,7 +929,8 @@ set_pwd (void)
if (posixly_correct && current_dir)
{
temp_var = bind_variable ("PWD", current_dir, 0);
set_auto_export (temp_var);
if (temp_var)
set_auto_export (temp_var);
}
free (current_dir);
}
@@ -938,7 +939,8 @@ set_pwd (void)
{
set_working_directory (home_string);
temp_var = bind_variable ("PWD", home_string, 0);
set_auto_export (temp_var);
if (temp_var)
set_auto_export (temp_var);
}
else
{
@@ -946,7 +948,8 @@ set_pwd (void)
if (temp_string)
{
temp_var = bind_variable ("PWD", temp_string, 0);
set_auto_export (temp_var);
if (temp_var)
set_auto_export (temp_var);
free (temp_string);
}
}