From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28609 invoked by alias); 12 Dec 2012 15:33:45 -0000 Received: (qmail 28593 invoked by uid 22791); 12 Dec 2012 15:33:43 -0000 X-SWARE-Spam-Status: No, hits=-7.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Dec 2012 15:33:36 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBCFXZjY004300 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 12 Dec 2012 10:33:35 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qBCFXX24004860; Wed, 12 Dec 2012 10:33:34 -0500 Message-ID: <50C8A3CD.3000608@redhat.com> Date: Wed, 12 Dec 2012 15:33:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Joel Brobecker CC: gdb-patches@sourceware.org Subject: Re: [commit/obv] Remove trailing space in gdbarch.sh. References: <1355320564-6481-1-git-send-email-brobecker@adacore.com> In-Reply-To: <1355320564-6481-1-git-send-email-brobecker@adacore.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-12/txt/msg00392.txt.bz2 On 12/12/2012 01:56 PM, Joel Brobecker wrote: > Hello, > > I noticed this trailing space when I ran an unmodified gdbarch.sh, > and yet got a difference in gdbarch.h! Fixed in gdbarch.sh. I don't see such a difference, but the patch is of course fine. git blame on the corresponding line on gdbarch.h points at: Author: Joel Brobecker Date: Wed Oct 26 21:23:54 2011 +0000 Regenerate gdbarch.h Not sure why, but the version currently checked in as an extraneous trailing whitespace that showed up as a diff when I reran gdbarch.sh. gdb/ChangeLog: * gdbarch.h: Regenerate. :-) I'm going to guess that you've been switching between systems, and on some of those /bin/sh is bash while on others its dash (most likely the latter is Ubuntu). Regenerating gdbarch.h from scratch with bash always ends up with that whitespace stripped for me. If I run 'dash ./gdbarch.sh' then indeed I see the extra space ending on up gdbarch.h. "read" trims leading and trailing whitespace by default (on bash at least). We can make it not do that by setting the IFS variable to empty, like in the patch below. This should make it so that all shells behave the same here (tried bash and dash), which I think would be good. WDYT? 2012-12-12 Pedro Alves * gdbarch.sh (do_read): Set IFS to blank. --- gdb/gdbarch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 81a70b0..7433378 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -47,7 +47,7 @@ do_read () { comment="" class="" - while read line + while IFS='' read line do if test "${line}" = "" then