public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@ericsson.com>
Subject: [PATCH] mi: Use the value in mi_console_file->quote as the quoting character
Date: Sat, 26 Apr 2014 22:10:00 -0000	[thread overview]
Message-ID: <1398550240-8712-1-git-send-email-simon.marchi@ericsson.com> (raw)

In mi_interpreter_init, multiple MI consoles/channels are created and a quoting
character is given.  In mi_console_raw_packet, we check if the value is not 0
to decide if we should quote the string, but we don't use the value. It is
hardcoded to ".  We might never use another quoting character than an actual
quote, but I suggest we change it, for correctness.  There is not visible
behavior change.

I changed the latest fputs_unfiltered changed to fputc_unfiltered just to stay
consistent.

gdb/ChangeLog:

2014-04-26  Simon Marchi  <simon.marchi@ericsson.com>

	* mi/mi-console.c (mi_console_raw_packet): Use the value from
	mi_console->quote as the quoting character.
---
 gdb/mi/mi-console.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gdb/mi/mi-console.c b/gdb/mi/mi-console.c
index dbad199..0880bd3 100644
--- a/gdb/mi/mi-console.c
+++ b/gdb/mi/mi-console.c
@@ -110,15 +110,16 @@ mi_console_raw_packet (void *data, const char *buf, long length_buf)
       fputs_unfiltered (mi_console->prefix, mi_console->raw);
       if (mi_console->quote)
 	{
-	  fputs_unfiltered ("\"", mi_console->raw);
+	  fputc_unfiltered (mi_console->quote, mi_console->raw);
 	  fputstrn_unfiltered (buf, length_buf,
 			       mi_console->quote, mi_console->raw);
-	  fputs_unfiltered ("\"\n", mi_console->raw);
+	  fputc_unfiltered (mi_console->quote, mi_console->raw);
+	  fputc_unfiltered ('\n', mi_console->raw);
 	}
       else
 	{
 	  fputstrn_unfiltered (buf, length_buf, 0, mi_console->raw);
-	  fputs_unfiltered ("\n", mi_console->raw);
+	  fputc_unfiltered ('\n', mi_console->raw);
 	}
       gdb_flush (mi_console->raw);
     }
-- 
1.9.1

             reply	other threads:[~2014-04-26 22:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-26 22:10 Simon Marchi [this message]
2014-04-29 17:21 ` Tom Tromey
2014-05-12 19:42   ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1398550240-8712-1-git-send-email-simon.marchi@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).