[commit/obv] Remove trailing space in gdbarch.sh.
Pedro Alves
palves@redhat.com
Thu Dec 13 10:32:00 GMT 2012
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
More information about the Gdb-patches
mailing list