summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2012-12-13 10:00:49 +0000
committerPedro Alves <palves@redhat.com>2012-12-13 10:00:49 +0000
commit90b47d84db1deb8001b7c82739b04bee5d8da9ef (patch)
tree008885dbaebc4ecbf43a88a98d890809f77da840
parent9ef356110a8ba16d7746b396697144fb30cab13a (diff)
downloadgdb-90b47d84db1deb8001b7c82739b04bee5d8da9ef.tar.gz
2012-12-13 Pedro Alves <palves@redhat.com>
* gdbarch.sh (do_read): Set IFS to blank.
-rw-r--r--gdb/ChangeLog4
-rwxr-xr-xgdb/gdbarch.sh5
2 files changed, 8 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5ea7d67d21e..272a4669218 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2012-12-13 Pedro Alves <palves@redhat.com>
+
+ * gdbarch.sh (do_read): Set IFS to blank.
+
2012-12-12 Mircea Gherzan <mircea.gherzan@intel.com>
* NEWS: Mention the -catch-load/-catch-unload MI commands.
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 887552eda99..8a56106e474 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