[PATCH] BASH_SOURCE_FULLPATH_DEFAULT fixup

2024-10-03 Thread Grisha Levit
Fix typo in configure.ac causing:

src/bash/configure: 3892: test: =: unexpected operator

Update shopt reset code to use new define.
---
 builtins/shopt.def | 2 +-
 configure.ac   | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/builtins/shopt.def b/builtins/shopt.def
index 1c7a3bd7..60f4ba67 100644
--- a/builtins/shopt.def
+++ b/builtins/shopt.def
@@ -376,7 +376,7 @@ reset_shopt_options (void)
   glob_ignore_case = match_ignore_case = 0;
   print_shift_error = 0;
   source_uses_path = promptvars = 1;
-  bash_source_fullpath = 0;
+  bash_source_fullpath = BASH_SOURCE_FULLPATH_DEFAULT;
   varassign_redir_autoclose = 0;
   singlequote_translations = 0;
   patsub_replacement = PATSUB_REPLACE_DEFAULT;
diff --git a/configure.ac b/configure.ac
index d29c8861..b23672a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,7 @@ dnl Process this file with autoconf to produce a configure 
script.
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see .
 
-AC_REVISION([for Bash 5.3, version 5.069])dnl
+AC_REVISION([for Bash 5.3, version 5.070])dnl
 
 define(bashvers, 5.3)
 define(relstatus, beta)
@@ -186,7 +186,7 @@ opt_function_import=yes
 opt_dev_fd_stat_broken=no
 opt_alt_array_impl=no
 opt_translatable_strings=yes
-opt_bash_source_fullpath=no
+opt_bash_source_fullpath_default=no
 
 dnl modified by alternate array implementation option
 ARRAY_O=array.o
@@ -212,7 +212,7 @@ if test $opt_minimal_config = yes; then
opt_casemod_attrs=no opt_casemod_expansions=no opt_extglob_default=no
opt_translatable_strings=no
opt_globascii_default=yes
-   opt_bash_source_fullpath=no
+   opt_bash_source_fullpath_default=no
 fi
 
 AC_ARG_ENABLE(alias, AS_HELP_STRING([--enable-alias], [enable shell aliases]), 
opt_alias=$enableval)
-- 
2.46.2




[PATCH] help -d: print loadable builtins correctly

2024-10-03 Thread Grisha Levit
help -d output assumes that long_doc[0] includes a newline, which is
not the case for loadable builtins:

$ enable ln rm
$ help -d ln rm
ln - Link files.rm - Remove files
---
 builtins/help.def | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/builtins/help.def b/builtins/help.def
index 770ded01..3277ccf5 100644
--- a/builtins/help.def
+++ b/builtins/help.def
@@ -265,13 +265,10 @@ show_desc (char *name, int i)
 line = doc ? doc[0] : (char *)NULL;
 
   printf ("%s - ", name);
-  for (j = 0; line && line[j]; j++)
-{
-  putchar (line[j]);
-  if (line[j] == '\n')
-   break;
-}
-  
+  for (j = 0; line && line[j] && line[j] != '\n'; j++)
+putchar (line[j]);
+  putchar ('\n');
+
   fflush (stdout);
 
   if (usefile)
-- 
2.46.2