This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug mi/15806] Some fields in async MI events get escaped twice


https://sourceware.org/bugzilla/show_bug.cgi?id=15806

--- Comment #10 from asmwarrior <asmwarrior at gmail dot com> ---
(In reply to asmwarrior from comment #9)
> 
> 5, So, we can change the if condition here is like:
>       if (c == '\\' ||  (c == quoter && quoter != 0))
> 	do_fputs ("\\", stream);
> 

Oh, there is a mistake in the above. The correct patch is:
 gdb/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/utils.c b/gdb/utils.c
index a8a7cb3..31bdb7e 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -1539,7 +1539,7 @@ printchar (int c, void (*do_fputs) (const char *, struct
ui_file *),
     }
   else
     {
-      if (c == '\\' || c == quoter)
+      if ( (c == '\\' && quoter != 0) || c == quoter)
     do_fputs ("\\", stream);
       do_fprintf (stream, "%c", c);
     }


But the result is still bad, which lead to some unexpected issue in my comment
4.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]