Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [commit/obv] Remove trailing space in gdbarch.sh.
Date: Thu, 13 Dec 2012 10:32:00 -0000	[thread overview]
Message-ID: <50C9AEB7.60706@redhat.com> (raw)
In-Reply-To: <20121213054613.GC3578@adacore.com>

On 12/13/2012 05:46 AM, Joel Brobecker wrote:

> This is my evil twin :-).

:-)

>> 2012-12-12  Pedro Alves  <palves@redhat.com>
>>
>> 	* gdbarch.sh (do_read): Set IFS to blank.
> 
> Looks good to me.
> 
> Good analysis, as /bin/sh is indeed a link to dash on my laptop.

Thanks for confirming.  I've applied it now, with an added comment.

2012-12-13  Pedro Alves  <palves@redhat.com>

	* gdbarch.sh (do_read): Set IFS to blank.

---
 gdb/gdbarch.sh |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 887552e..8a56106 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -47,7 +47,10 @@ do_read ()
 {
     comment=""
     class=""
-    while read line
+    # On some SH's, 'read' trims leading and trailing whitespace by
+    # default (e.g., bash), while on others (e.g., dash), it doesn't.
+    # Set IFS to empty to disable the trimming everywhere.
+    while IFS='' read line
     do
 	if test "${line}" = ""
 	then


      reply	other threads:[~2012-12-13 10:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-12 13:56 Joel Brobecker
2012-12-12 15:33 ` Pedro Alves
2012-12-12 15:46   ` Tom Tromey
2012-12-13  5:47   ` Joel Brobecker
2012-12-13 10:32     ` Pedro Alves [this message]

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=50C9AEB7.60706@redhat.com \
    --to=palves@redhat.com \
    --cc=brobecker@adacore.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