Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package bash for openSUSE:Factory checked in 
at 2024-09-25 21:51:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/bash (Old)
 and      /work/SRC/openSUSE:Factory/.bash.new.29891 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "bash"

Wed Sep 25 21:51:33 2024 rev:193 rq:1203319 version:5.2.MACRO

Changes:
--------
--- /work/SRC/openSUSE:Factory/bash/bash.changes        2024-08-20 
16:12:22.543625254 +0200
+++ /work/SRC/openSUSE:Factory/.bash.new.29891/bash.changes     2024-09-25 
21:51:40.180232793 +0200
@@ -1,0 +2,26 @@
+Wed Sep 25 06:33:29 UTC 2024 - Dr. Werner Fink <wer...@suse.de>
+
+- Add upstream patches
+  * bash52-037
+    Fix the case where text to be completed from the line buffer (quoted) is
+    compared to the common prefix of the possible matches (unquoted) and the
+    quoting makes the former appear to be longer than the latter. Readline
+    assumes the match doesn't add any characters to the word and doesn't 
display
+    multiple matches.
+  * bash52-036
+    When readline is accumulating bytes until it reads a complete multibyte
+    character, reading a byte that makes the multibyte character invalid can
+    result in discarding the bytes in the partial character.
+  * bash52-035
+    There are systems that supply one of select or pselect, but not both.
+  * bash52-034
+    If we parse a compound assignment during an alias expansion, it's possible
+    to have the current input string popped out from underneath the parse. In
+    this case, we should not restore the input we were using when we began to
+    parse the compound assignment.
+  * bash52-033
+    A typo in the autoconf test for strtold causes false negatives for strtold
+    being available and working when compiled with gcc-14.
+- Port patch bash-3.2-printf.patch to fit change in bash52-033
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ bash-3.2-printf.patch ++++++
--- /var/tmp/diff_new_pack.q0VTFc/_old  2024-09-25 21:51:41.848302274 +0200
+++ /var/tmp/diff_new_pack.q0VTFc/_new  2024-09-25 21:51:41.852302441 +0200
@@ -24,7 +24,7 @@
 @@ -710,7 +711,12 @@ printf_builtin (list)
  
                    p = getfloatmax ();
-                   f = mklong (start, "L", 1);
+                   f = mklong (start, FLOATMAX_CONV, USE_LONG_DOUBLE);
 +
 +                  if (lce && lcl) setlocale(LC_NUMERIC, lce);
 +

++++++ bash-5.2-patches.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bash-5.2-patches/bash52-027 
new/bash-5.2-patches/bash52-027
--- old/bash-5.2-patches/bash52-027     2024-07-31 17:07:10.000000000 +0200
+++ new/bash-5.2-patches/bash52-027     2024-08-19 11:00:26.254587337 +0200
@@ -15,7 +15,7 @@
 Patch (apply with `patch -p0'):
 
 
-*** ../bash-5.2-patched/m4/strtoimax.m4        Mon Apr 11 16:31:52 2022
+*** m4/strtoimax.m4    Mon Apr 11 16:31:52 2022
 --- m4/strtoimax.m4    Tue Apr  9 11:12:36 2024
 ***************
 *** 30,34 ****
@@ -46,7 +46,7 @@
   case " $LIBOBJS " in
     *" strtoimax.$ac_objext "* ) ;;
 
-*** ../bash-5.2/patchlevel.h   2020-06-22 14:51:03.000000000 -0400
+*** patchlevel.h       2020-06-22 14:51:03.000000000 -0400
 --- patchlevel.h       2020-10-01 11:01:28.000000000 -0400
 ***************
 *** 26,30 ****
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bash-5.2-patches/bash52-028 
new/bash-5.2-patches/bash52-028
--- old/bash-5.2-patches/bash52-028     2024-07-31 17:07:22.000000000 +0200
+++ new/bash-5.2-patches/bash52-028     2024-08-19 11:00:26.270587052 +0200
@@ -32,7 +32,7 @@
 !       if (job_control && pipeline_pgrp > 0 && ((subshell_environment & 
(SUBSHELL_ASYNC|SUBSHELL_PIPE)) == 0))
        give_terminal_to (pipeline_pgrp, 1);
   
-*** ../bash-5.2/patchlevel.h   2020-06-22 14:51:03.000000000 -0400
+*** patchlevel.h       2020-06-22 14:51:03.000000000 -0400
 --- patchlevel.h       2020-10-01 11:01:28.000000000 -0400
 ***************
 *** 26,30 ****
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bash-5.2-patches/bash52-029 
new/bash-5.2-patches/bash52-029
--- old/bash-5.2-patches/bash52-029     2024-07-31 17:07:34.000000000 +0200
+++ new/bash-5.2-patches/bash52-029     2024-08-19 11:00:26.278586908 +0200
@@ -120,7 +120,7 @@
       }
   
 
-*** ../bash-5.2/patchlevel.h   2020-06-22 14:51:03.000000000 -0400
+*** patchlevel.h       2020-06-22 14:51:03.000000000 -0400
 --- patchlevel.h       2020-10-01 11:01:28.000000000 -0400
 ***************
 *** 26,30 ****
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bash-5.2-patches/bash52-030 
new/bash-5.2-patches/bash52-030
--- old/bash-5.2-patches/bash52-030     2024-07-31 17:07:47.000000000 +0200
+++ new/bash-5.2-patches/bash52-030     2024-08-19 11:00:26.290586694 +0200
@@ -15,7 +15,7 @@
 
 Patch (apply with `patch -p0'):
 
-*** ../bash-5.2-patched/jobs.c Thu Nov  9 14:59:14 2023
+*** jobs.c     Thu Nov  9 14:59:14 2023
 --- jobs.c     Tue Jul 30 15:27:44 2024
 ***************
 *** 4275,4279 ****
@@ -113,7 +113,7 @@
              break;
   
 
-*** ../bash-5.2/patchlevel.h   2020-06-22 14:51:03.000000000 -0400
+*** patchlevel.h       2020-06-22 14:51:03.000000000 -0400
 --- patchlevel.h       2020-10-01 11:01:28.000000000 -0400
 ***************
 *** 26,30 ****
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bash-5.2-patches/bash52-031 
new/bash-5.2-patches/bash52-031
--- old/bash-5.2-patches/bash52-031     2024-07-31 17:07:57.000000000 +0200
+++ new/bash-5.2-patches/bash52-031     2024-08-19 11:00:26.302586481 +0200
@@ -15,7 +15,7 @@
 
 Patch (apply with `patch -p0'):
 
-*** ../bash-5.2-patched/builtins/evalstring.c  Tue Dec 13 12:53:21 2022
+*** builtins/evalstring.c      Tue Dec 13 12:53:21 2022
 --- builtins/evalstring.c      Tue Nov 28 17:25:39 2023
 ***************
 *** 763,766 ****
@@ -28,7 +28,7 @@
     return fd;
   }
 
-*** ../bash-5.2/patchlevel.h   2020-06-22 14:51:03.000000000 -0400
+*** patchlevel.h       2020-06-22 14:51:03.000000000 -0400
 --- patchlevel.h       2020-10-01 11:01:28.000000000 -0400
 ***************
 *** 26,30 ****
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bash-5.2-patches/bash52-032 
new/bash-5.2-patches/bash52-032
--- old/bash-5.2-patches/bash52-032     2024-07-31 17:08:13.000000000 +0200
+++ new/bash-5.2-patches/bash52-032     2024-08-19 11:00:26.314586267 +0200
@@ -16,7 +16,7 @@
 has the word COPROC inserted unconditionally, resulting in function bodies
 that cannot be re-read as input.
 
-*** ../bash-5.2-patched/print_cmd.c    Mon Aug 21 16:09:44 2023
+*** print_cmd.c        Mon Aug 21 16:09:44 2023
 --- print_cmd.c        Mon Dec 11 15:34:30 2023
 ***************
 *** 357,361 ****
@@ -34,7 +34,7 @@
          skip_this_indent++;
          make_command_string_internal (command->value.Coproc->command);
 
-*** ../bash-5.2/patchlevel.h   2020-06-22 14:51:03.000000000 -0400
+*** patchlevel.h       2020-06-22 14:51:03.000000000 -0400
 --- patchlevel.h       2020-10-01 11:01:28.000000000 -0400
 ***************
 *** 26,30 ****
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bash-5.2-patches/bash52-033 
new/bash-5.2-patches/bash52-033
--- old/bash-5.2-patches/bash52-033     1970-01-01 01:00:00.000000000 +0100
+++ new/bash-5.2-patches/bash52-033     2024-09-23 23:54:04.000000000 +0200
@@ -0,0 +1,80 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  5.2
+Patch-ID:      bash52-033
+
+Bug-Reported-by:       Florian Weimer <fwei...@redhat.com>
+Bug-Reference-ID:      <87leasmvoo....@oldenburg.str.redhat.com>
+Bug-Reference-URL:     
https://lists.gnu.org/archive/html/bug-bash/2023-11/msg00104.html
+
+Bug-Description:
+
+A typo in the autoconf test for strtold causes false negatives for strtold
+being available and working when compiled with gcc-14.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-5.2-patched/configure.ac   Fri Aug 11 14:52:31 2023
+--- configure.ac       Tue Nov 21 12:00:25 2023
+***************
+*** 899,903 ****
+               [AC_LANG_PROGRAM(
+               [[#include <stdlib.h>]],
+!              [[long double r; char *foo, bar; r = strtold(foo, &bar);]]
+       )],
+       [bash_cv_strtold_broken=no],[bash_cv_strtold_broken=yes])
+--- 900,904 ----
+               [AC_LANG_PROGRAM(
+               [[#include <stdlib.h>]],
+!              [[long double r; char *foo, *bar; r = strtold(foo, &bar);]]
+       )],
+       [bash_cv_strtold_broken=no],[bash_cv_strtold_broken=yes])
+
+*** ../bash-5.2-patched/configure      Fri Aug 18 16:27:53 2023
+--- configure  Tue Nov 21 12:00:30 2023
+***************
+*** 15923,15927 ****
+  main (void)
+  {
+! long double r; char *foo, bar; r = strtold(foo, &bar);
+  
+    ;
+--- 15932,15936 ----
+  main (void)
+  {
+! long double r; char *foo, *bar; r = strtold(foo, &bar);
+  
+    ;
+
+*** ../bash-5.2-patched/builtins/printf.def    Fri Jun 24 10:09:50 2022
+--- builtins/printf.def        Tue Aug 13 10:36:55 2024
+***************
+*** 710,714 ****
+  
+                   p = getfloatmax ();
+!                  f = mklong (start, "L", 1);
+                   PF (f, p);
+                 }
+--- 710,714 ----
+  
+                   p = getfloatmax ();
+!                  f = mklong (start, FLOATMAX_CONV, USE_LONG_DOUBLE);
+                   PF (f, p);
+                 }
+
+*** ../bash-5.2/patchlevel.h   2020-06-22 14:51:03.000000000 -0400
+--- patchlevel.h       2020-10-01 11:01:28.000000000 -0400
+***************
+*** 26,30 ****
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 32
+  
+  #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 33
+  
+  #endif /* _PATCHLEVEL_H_ */
Binary files old/bash-5.2-patches/bash52-033.sig and 
new/bash-5.2-patches/bash52-033.sig differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bash-5.2-patches/bash52-034 
new/bash-5.2-patches/bash52-034
--- old/bash-5.2-patches/bash52-034     1970-01-01 01:00:00.000000000 +0100
+++ new/bash-5.2-patches/bash52-034     2024-09-23 23:54:19.000000000 +0200
@@ -0,0 +1,143 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  5.2
+Patch-ID:      bash52-034
+
+Bug-Reported-by:       Wiley Young <wyeth2...@gmail.com>
+Bug-Reference-ID:      
<CAGnujaPrPV9hgbvdtG=fos+l1zvgeaht9d3aw0e1y3qj8d8...@mail.gmail.com>
+Bug-Reference-URL:     
https://lists.gnu.org/archive/html/bug-bash/2023-05/msg00146.html
+
+Bug-Description:
+
+If we parse a compound assignment during an alias expansion, it's possible
+to have the current input string popped out from underneath the parse. In
+this case, we should not restore the input we were using when we began to
+parse the compound assignment.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-5.2-patched/parse.y        Fri May 26 16:57:03 2023
+--- parse.y    Thu Jun  1 16:30:19 2023
+***************
+*** 6854,6860 ****
+  {
+    WORD_LIST *wl, *rl;
+!   int tok, orig_line_number, assignok;
+    sh_parser_state_t ps;
+    char *ret;
+  
+    orig_line_number = line_number;
+--- 6858,6865 ----
+  {
+    WORD_LIST *wl, *rl;
+!   int tok, orig_line_number, assignok, ea, restore_pushed_strings;
+    sh_parser_state_t ps;
+    char *ret;
++   STRING_SAVER *ss;
+  
+    orig_line_number = line_number;
+***************
+*** 6879,6882 ****
+--- 6884,6893 ----
+    esacs_needed_count = expecting_in_token = 0;
+  
++   /* We're not pushing any new input here, we're reading from the current 
input
++      source. If that's an alias, we have to be prepared for the alias to get
++      popped out from underneath us. */
++   ss = (ea = expanding_alias ()) ? pushed_string_list : (STRING_SAVER *)NULL;
++   restore_pushed_strings = 0;
++     
+    while ((tok = read_token (READ)) != ')')
+      {
+***************
+*** 6902,6906 ****
+--- 6913,6926 ----
+      }
+  
++   /* Check whether or not an alias got popped out from underneath us and
++      fix up after restore_parser_state. */
++   if (ea && ss && ss != pushed_string_list)
++     {
++       restore_pushed_strings = 1;
++       ss = pushed_string_list;
++     }
+    restore_parser_state (&ps);
++   if (restore_pushed_strings)
++     pushed_string_list = ss;
+  
+    if (wl == &parse_string_error)
+*** ../bash-5.2-patched/y.tab.c        Mon Sep 23 10:02:46 2024
+--- y.tab.c    Mon Sep 23 10:02:49 2024
+***************
+*** 8804,8812 ****
+       int *retlenp;
+  {
+    WORD_LIST *wl, *rl;
+!   int tok, orig_line_number, assignok;
+    sh_parser_state_t ps;
+    char *ret;
+  
+    orig_line_number = line_number;
+    save_parser_state (&ps);
+--- 8804,8813 ----
+       int *retlenp;
+  {
+    WORD_LIST *wl, *rl;
+!   int tok, orig_line_number, assignok, ea, restore_pushed_strings;
+    sh_parser_state_t ps;
+    char *ret;
++   STRING_SAVER *ss;
+  
+    orig_line_number = line_number;
+    save_parser_state (&ps);
+***************
+*** 8829,8834 ****
+--- 8830,8841 ----
+  
+    esacs_needed_count = expecting_in_token = 0;
+  
++   /* We're not pushing any new input here, we're reading from the current 
input
++      source. If that's an alias, we have to be prepared for the alias to get
++      popped out from underneath us. */
++   ss = (ea = expanding_alias ()) ? pushed_string_list : (STRING_SAVER *)NULL;
++   restore_pushed_strings = 0;
++     
+    while ((tok = read_token (READ)) != ')')
+      {
+        if (tok == '\n')                       /* Allow newlines in compound 
assignments */
+***************
+*** 8852,8858 ****
+--- 8859,8874 ----
+        wl = make_word_list (yylval.word, wl);
+      }
+  
++   /* Check whether or not an alias got popped out from underneath us and
++      fix up after restore_parser_state. */
++   if (ea && ss && ss != pushed_string_list)
++     {
++       restore_pushed_strings = 1;
++       ss = pushed_string_list;
++     }
+    restore_parser_state (&ps);
++   if (restore_pushed_strings)
++     pushed_string_list = ss;
+  
+    if (wl == &parse_string_error)
+      {
+
+*** ../bash-5.2/patchlevel.h   2020-06-22 14:51:03.000000000 -0400
+--- patchlevel.h       2020-10-01 11:01:28.000000000 -0400
+***************
+*** 26,30 ****
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 33
+  
+  #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 34
+  
+  #endif /* _PATCHLEVEL_H_ */
Binary files old/bash-5.2-patches/bash52-034.sig and 
new/bash-5.2-patches/bash52-034.sig differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bash-5.2-patches/bash52-035 
new/bash-5.2-patches/bash52-035
--- old/bash-5.2-patches/bash52-035     1970-01-01 01:00:00.000000000 +0100
+++ new/bash-5.2-patches/bash52-035     2024-09-23 23:54:31.000000000 +0200
@@ -0,0 +1,129 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  5.2
+Patch-ID:      bash52-035
+
+Bug-Reported-by:       Henry Bent <henry.r.b...@gmail.com>
+Bug-Reference-ID:      
<caedtpbdd0wow2n0-y-xyz_vwhbig-os3bxfgkoppg617rgh...@mail.gmail.com>
+Bug-Reference-URL:     
https://lists.gnu.org/archive/html/bug-bash/2022-11/msg00044.html
+
+Bug-Description:
+
+There are systems that supply one of select or pselect, but not both.
+
+Patch (apply with `patch -p0'):
+
+https://lists.gnu.org/archive/html/bug-bash/2022-11/msg00058.html
+
+*** ../bash/bash-5.2-patched/lib/readline/input.c      2022-04-08 
15:43:24.000000000 -0400
+--- lib/readline/input.c       2022-11-16 09:10:41.000000000 -0500
+***************
+*** 152,156 ****
+--- 152,158 ----
+  int _rl_timeout_init (void);
+  int _rl_timeout_sigalrm_handler (void);
++ #if defined (RL_TIMEOUT_USE_SELECT)
+  int _rl_timeout_select (int, fd_set *, fd_set *, fd_set *, const struct 
timeval *, const sigset_t *);
++ #endif
+  
+  static void _rl_timeout_handle (void);
+***************
+*** 249,253 ****
+    int chars_avail, k;
+    char input;
+! #if defined(HAVE_SELECT)
+    fd_set readfds, exceptfds;
+    struct timeval timeout;
+--- 251,255 ----
+    int chars_avail, k;
+    char input;
+! #if defined (HAVE_PSELECT) || defined (HAVE_SELECT)
+    fd_set readfds, exceptfds;
+    struct timeval timeout;
+***************
+*** 806,810 ****
+    unsigned char c;
+    int fd;
+! #if defined (HAVE_PSELECT)
+    sigset_t empty_set;
+    fd_set readfds;
+--- 808,812 ----
+    unsigned char c;
+    int fd;
+! #if defined (HAVE_PSELECT) || defined (HAVE_SELECT)
+    sigset_t empty_set;
+    fd_set readfds;
+*** ../bash-5.2-patched/lib/sh/input_avail.c   2021-05-24 11:16:33.000000000 
-0400
+--- lib/sh/input_avail.c       2022-11-16 09:12:48.000000000 -0500
+***************
+*** 34,40 ****
+  #endif /* HAVE_SYS_FILE_H */
+  
+! #if defined (HAVE_PSELECT)
+! #  include <signal.h>
+! #endif
+  
+  #if defined (HAVE_UNISTD_H)
+--- 34,38 ----
+  #endif /* HAVE_SYS_FILE_H */
+  
+! #include <signal.h>
+  
+  #if defined (HAVE_UNISTD_H)
+***************
+*** 108,115 ****
+  {
+    int result, chars_avail;
+- #if defined(HAVE_SELECT)
+-   fd_set readfds, exceptfds;
+- #endif
+  #if defined (HAVE_PSELECT) || defined (HAVE_SELECT)
+    sigset_t set, oset;
+  #endif
+--- 106,111 ----
+  {
+    int result, chars_avail;
+  #if defined (HAVE_PSELECT) || defined (HAVE_SELECT)
++   fd_set readfds, exceptfds;
+    sigset_t set, oset;
+  #endif
+***************
+*** 122,132 ****
+    chars_avail = 0;
+  
+! #if defined (HAVE_SELECT)
+    FD_ZERO (&readfds);
+    FD_ZERO (&exceptfds);
+    FD_SET (fd, &readfds);
+    FD_SET (fd, &exceptfds);
+- #endif
+- #if defined (HAVE_SELECT) || defined (HAVE_PSELECT)
+    sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &set);
+  #  ifdef SIGCHLD
+--- 115,123 ----
+    chars_avail = 0;
+  
+! #if defined (HAVE_PSELECT) || defined (HAVE_SELECT)
+    FD_ZERO (&readfds);
+    FD_ZERO (&exceptfds);
+    FD_SET (fd, &readfds);
+    FD_SET (fd, &exceptfds);
+    sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &set);
+  #  ifdef SIGCHLD
+
+*** ../bash-5.2/patchlevel.h   2020-06-22 14:51:03.000000000 -0400
+--- patchlevel.h       2020-10-01 11:01:28.000000000 -0400
+***************
+*** 26,30 ****
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 34
+  
+  #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 35
+  
+  #endif /* _PATCHLEVEL_H_ */
Binary files old/bash-5.2-patches/bash52-035.sig and 
new/bash-5.2-patches/bash52-035.sig differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bash-5.2-patches/bash52-036 
new/bash-5.2-patches/bash52-036
--- old/bash-5.2-patches/bash52-036     1970-01-01 01:00:00.000000000 +0100
+++ new/bash-5.2-patches/bash52-036     2024-09-23 23:55:06.000000000 +0200
@@ -0,0 +1,237 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  5.2
+Patch-ID:      bash52-036
+
+Bug-Reported-by:        Grisha Levit <grishale...@gmail.com>
+Bug-Reference-ID:       
<CAMu=Brrv5qKY6LPfw8PxqNXNO8rNsZo0Fb=bcfb-uhobwpq...@mail.gmail.com>
+Bug-Reference-URL:     
https://lists.gnu.org/archive/html/bug-bash/2023-04/msg00082.html
+
+Bug-Description:
+
+When readline is accumulating bytes until it reads a complete multibyte
+character, reading a byte that makes the multibyte character invalid can
+result in discarding the bytes in the partial character.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-5.2-patched/lib/readline/text.c    Mon May  1 09:37:52 2023
+--- lib/readline/text.c        Mon May 29 12:22:29 2023
+***************
+*** 86,90 ****
+  rl_insert_text (const char *string)
+  {
+!   register int i, l;
+  
+    l = (string && *string) ? strlen (string) : 0;
+--- 86,91 ----
+  rl_insert_text (const char *string)
+  {
+!   register int i;
+!   size_t l;
+  
+    l = (string && *string) ? strlen (string) : 0;
+***************
+*** 705,709 ****
+  /* Insert the character C at the current location, moving point forward.
+     If C introduces a multibyte sequence, we read the whole sequence and
+!    then insert the multibyte char into the line buffer. */
+  int
+  _rl_insert_char (int count, int c)
+--- 706,714 ----
+  /* Insert the character C at the current location, moving point forward.
+     If C introduces a multibyte sequence, we read the whole sequence and
+!    then insert the multibyte char into the line buffer.
+!    If C == 0, we immediately insert any pending partial multibyte character,
+!    assuming that we have read a character that doesn't map to self-insert.
+!    This doesn't completely handle characters that are part of a multibyte
+!    character but map to editing functions. */
+  int
+  _rl_insert_char (int count, int c)
+***************
+*** 719,727 ****
+  #endif
+  
+    if (count <= 0)
+      return 0;
+  
+! #if defined (HANDLE_MULTIBYTE)
+!   if (MB_CUR_MAX == 1 || rl_byte_oriented)
+      {
+        incoming[0] = c;
+--- 724,749 ----
+  #endif
+  
++ #if !defined (HANDLE_MULTIBYTE)
+    if (count <= 0)
+      return 0;
++ #else
++   if (count < 0)
++     return 0;
++   if (count == 0)
++     {
++       if (pending_bytes_length == 0)
++      return 0;
++       if (stored_count <= 0)
++      stored_count = count;
++       else
++      count = stored_count;
+  
+!       memcpy (incoming, pending_bytes, pending_bytes_length);
+!       incoming[pending_bytes_length] = '\0';
+!       incoming_length = pending_bytes_length;
+!       pending_bytes_length = 0;
+!       memset (&ps, 0, sizeof (mbstate_t));
+!     }
+!   else if (MB_CUR_MAX == 1 || rl_byte_oriented)
+      {
+        incoming[0] = c;
+***************
+*** 731,734 ****
+--- 753,759 ----
+    else if (_rl_utf8locale && (c & 0x80) == 0)
+      {
++       if (pending_bytes_length)
++      _rl_insert_char (0, 0);
++ 
+        incoming[0] = c;
+        incoming[1] = '\0';
+***************
+*** 765,769 ****
+         incoming_length = 1;
+         pending_bytes_length--;
+!        memmove (pending_bytes, pending_bytes + 1, pending_bytes_length);
+         /* Clear the state of the byte sequence, because in this case the
+            effect of mbstate is undefined. */
+--- 790,795 ----
+         incoming_length = 1;
+         pending_bytes_length--;
+!        if (pending_bytes_length)
+!          memmove (pending_bytes, pending_bytes + 1, pending_bytes_length);
+         /* Clear the state of the byte sequence, because in this case the
+            effect of mbstate is undefined. */
+***************
+*** 828,832 ****
+--- 854,862 ----
+        xfree (string);
+  
++ #if defined (HANDLE_MULTIBYTE)
++       return (pending_bytes_length != 0);
++ #else
+        return 0;
++ #endif
+      }
+  
+***************
+*** 861,864 ****
+--- 891,896 ----
+        incoming_length = 0;
+        stored_count = 0;
++ 
++       return (pending_bytes_length != 0);
+  #else /* !HANDLE_MULTIBYTE */
+        char str[TEXT_COUNT_MAX+1];
+***************
+*** 874,880 ****
+         count -= decreaser;
+       }
+- #endif /* !HANDLE_MULTIBYTE */
+  
+        return 0;
+      }
+  
+--- 906,912 ----
+         count -= decreaser;
+       }
+  
+        return 0;
++ #endif /* !HANDLE_MULTIBYTE */
+      }
+  
+***************
+*** 904,910 ****
+        stored_count = 0;
+      }
+! #endif
+! 
+    return 0;
+  }
+  
+--- 936,944 ----
+        stored_count = 0;
+      }
+!   
+!   return (pending_bytes_length != 0);
+! #else
+    return 0;
++ #endif
+  }
+  
+***************
+*** 984,987 ****
+--- 1018,1026 ----
+      }
+  
++   /* If we didn't insert n and there are pending bytes, we need to insert
++      them if _rl_insert_char didn't do that on its own. */
++   if (r == 1 && rl_insert_mode == RL_IM_INSERT)
++     r = _rl_insert_char (0, 0);              /* flush partial multibyte char 
*/
++ 
+    if (n != (unsigned short)-2)               /* -2 = sentinel value for 
having inserted N */
+      {
+***************
+*** 1055,1058 ****
+--- 1094,1099 ----
+  rl_quoted_insert (int count, int key)
+  {
++   int r;
++ 
+    /* Let's see...should the callback interface futz with signal handling? */
+  #if defined (HANDLE_SIGNALS)
+***************
+*** 1073,1085 ****
+    if (count < 0)
+      {
+-       int r;
+- 
+        do
+       r = _rl_insert_next (1);
+        while (r == 0 && ++count < 0);
+-       return r;
+      }
+  
+!   return _rl_insert_next (count);
+  }
+  
+--- 1114,1128 ----
+    if (count < 0)
+      {
+        do
+       r = _rl_insert_next (1);
+        while (r == 0 && ++count < 0);
+      }
++   else
++     r = _rl_insert_next (count);
+  
+!   if (r == 1)
+!     _rl_insert_char (0, 0);  /* insert partial multibyte character */
+! 
+!   return r;
+  }
+  
+*** ../bash-5.2/patchlevel.h   2020-06-22 14:51:03.000000000 -0400
+--- patchlevel.h       2020-10-01 11:01:28.000000000 -0400
+***************
+*** 26,30 ****
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 35
+  
+  #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 36
+  
+  #endif /* _PATCHLEVEL_H_ */
Binary files old/bash-5.2-patches/bash52-036.sig and 
new/bash-5.2-patches/bash52-036.sig differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bash-5.2-patches/bash52-037 
new/bash-5.2-patches/bash52-037
--- old/bash-5.2-patches/bash52-037     1970-01-01 01:00:00.000000000 +0100
+++ new/bash-5.2-patches/bash52-037     2024-09-23 23:55:19.000000000 +0200
@@ -0,0 +1,71 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  5.2
+Patch-ID:      bash52-037
+
+Bug-Reported-by:        Martin Castillo <casti...@uni-bremen.de>
+Bug-Reference-ID:       <2d42153b-cf65-caba-dff1-cd3bc6268...@uni-bremen.de>
+Bug-Reference-URL:     
https://lists.gnu.org/archive/html/bug-readline/2023-01/msg00000.html
+
+Bug-Description:
+
+Fix the case where text to be completed from the line buffer (quoted) is
+compared to the common prefix of the possible matches (unquoted) and the
+quoting makes the former appear to be longer than the latter. Readline
+assumes the match doesn't add any characters to the word and doesn't display
+multiple matches.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-5.2-patched/lib/readline/complete.c        Tue Apr  5 10:47:06 2022
+--- lib/readline/complete.c    Sat Jan  7 14:19:45 2023
+***************
+*** 2032,2038 ****
+    text = rl_copy_text (start, end);
+    matches = gen_completion_matches (text, start, end, our_func, found_quote, 
quote_char);
+    /* nontrivial_lcd is set if the common prefix adds something to the word
+       being completed. */
+!   nontrivial_lcd = matches && compare_match (text, matches[0]) != 0;
+    if (what_to_do == '!' || what_to_do == '@')
+      tlen = strlen (text);
+--- 2038,2060 ----
+    text = rl_copy_text (start, end);
+    matches = gen_completion_matches (text, start, end, our_func, found_quote, 
quote_char);
++   /* If TEXT contains quote characters, it will be dequoted as part of
++      generating the matches, and the matches will not contain any quote
++      characters. We need to dequote TEXT before performing the comparison.
++      Since compare_match performs the dequoting, and we only want to do it
++      once, we don't call compare_matches after dequoting TEXT; we call
++      strcmp directly. */
+    /* nontrivial_lcd is set if the common prefix adds something to the word
+       being completed. */
+!   if (rl_filename_completion_desired && rl_filename_quoting_desired &&
+!       rl_completion_found_quote && rl_filename_dequoting_function)
+!     {
+!       char *t;
+!       t = (*rl_filename_dequoting_function) (text, 
rl_completion_quote_character);
+!       xfree (text);
+!       text = t;
+!       nontrivial_lcd = matches && strcmp (text, matches[0]) != 0;
+!     }
+!   else
+!     nontrivial_lcd = matches && strcmp (text, matches[0]) != 0;
+    if (what_to_do == '!' || what_to_do == '@')
+      tlen = strlen (text);
+
+*** ../bash-5.2/patchlevel.h   2020-06-22 14:51:03.000000000 -0400
+--- patchlevel.h       2020-10-01 11:01:28.000000000 -0400
+***************
+*** 26,30 ****
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 36
+  
+  #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 37
+  
+  #endif /* _PATCHLEVEL_H_ */
Binary files old/bash-5.2-patches/bash52-037.sig and 
new/bash-5.2-patches/bash52-037.sig differ

Reply via email to