[binutils-gdb] gas: scrubber handling of string continuation across lines

Jan Beulich via Binutils-cvs <[email protected]> Fri, 17 Jul 2026 07:25:55 +0000 (GMT)
Newsgroups gmane.comp.gnu.binutils.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D59d681f3a827=
8d29a74dfd7de8ef276d08b717cf

commit 59d681f3a8278d29a74dfd7de8ef276d08b717cf
Author: Jan Beulich <[email protected]>
Date:   Fri Jul 17 09:23:55 2026 +0200

    gas: scrubber handling of string continuation across lines
   =20
    Apparently forever (according to [available] history) two backslashes h=
ave
    been emitted when, afaict, only one was meant.

Diff:
---
 gas/app.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gas/app.c b/gas/app.c
index 3410e696572..e5b65bc0152 100644
--- a/gas/app.c
+++ b/gas/app.c
@@ -694,12 +694,12 @@ do_scrub_chars (size_t (*get) (char *, size_t), char =
*tostart, size_t tolen,
 	  ch =3D GET ();
 	  switch (ch)
 	    {
-	      /* Handle strings broken across lines, by turning '\n' into
-		 '\\' and 'n'.  */
+	      /* Handle strings broken across lines, by turning '\\' followed
+		 by '\n' into '\\' (already emitted when state moved to 6) and
+		 'n'.  */
 	    case '\n':
-	      UNGET ('n');
 	      add_newlines++;
-	      PUT ('\\');
+	      PUT ('n');
 	      continue;
=20
 	    case EOF: