From patchwork Sat Apr 26 22:10:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 689 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 0264B360075 for ; Sat, 26 Apr 2014 15:10:48 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14314964) id A5BA041325D6B; Sat, 26 Apr 2014 15:10:48 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx20.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx20.g.dreamhost.com (Postfix) with ESMTPS id 7C5F1412CFEB4 for ; Sat, 26 Apr 2014 15:10:48 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=pchvDVYbN5NMbaAa3Av1E7obM/ZpOt+eRtC7UL6g+l5xTh1CN6XTS HzNzMrEyGiaMbiCoa/BWCqicr/RoxgXyQ0sgFU7cacpkcU/mBBUV0pYg7XWzWZmM O1ZuhuSBMNdOs1HmSYh6xm29QeT5xqXuhsoKUMQObQn8/T3jC3mAl0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=2BfBqsfY5qGuY9l/3XXTFVUEdFs=; b=oAXlJypFAgGFp6wiuH52tlkuW2/K i9+8HKu/BdErE/3AI4OsmJdTJpfARdhecQhH/IM3sa+ByKWI8KQMkQWzQjYiKM58 lNIDYcGIhein097rvS74Ggis9HJ0ll82jmSapTLysSSOzRCEr/W6uyz+GG7aBAGA z8Q5XEij9PtP9cI= Received: (qmail 13696 invoked by alias); 26 Apr 2014 22:10:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 13679 invoked by uid 89); 26 Apr 2014 22:10:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: smtp.electronicbox.net Received: from smtp.electronicbox.net (HELO smtp.electronicbox.net) (96.127.255.82) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 26 Apr 2014 22:10:43 +0000 Received: from localhost.localdomain (unknown [96.127.221.218]) by smtp.electronicbox.net (Postfix) with ESMTP id 7D922DF37E; Sat, 26 Apr 2014 17:58:21 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH] mi: Use the value in mi_console_file->quote as the quoting character Date: Sat, 26 Apr 2014 18:10:40 -0400 Message-Id: <1398550240-8712-1-git-send-email-simon.marchi@ericsson.com> X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in 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 * 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); }