Index: external/gpl3/binutils/dist/gas/sb.c =================================================================== RCS file: /cvsroot/src/external/gpl3/binutils/dist/gas/sb.c,v retrieving revision 1.1.1.8 diff -p -u -r1.1.1.8 sb.c --- external/gpl3/binutils/dist/gas/sb.c 23 Dec 2022 19:01:17 -0000 1.1.1.8 +++ external/gpl3/binutils/dist/gas/sb.c 29 Jan 2023 14:35:21 -0000 @@ -121,11 +121,25 @@ sb_scrub_and_add_sb (sb *ptr, sb *s) { size_t copy = s->len - (scrub_position - s->ptr); if (copy == 0) - break; + break; sb_check (ptr, copy); ptr->len += do_scrub_chars (scrub_from_sb, ptr->ptr + ptr->len, copy); } + /* 1. expand output buffer a bit (e.g. 8 bytes for "linefile"). + * 2. try to scrub more + * 3. finish when no more output was generated */ + while (1) + { + size_t more; + + sb_check(ptr, 8); + more = do_scrub_chars (scrub_from_sb, ptr->ptr + ptr->len, 8); + if (more == 0) + break; + ptr->len += more; + } + sb_to_scrub = 0; scrub_position = 0; }