aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorKazu Hirata <kazu@codesourcery.com>2001-01-25 20:12:49 +0000
committerKazu Hirata <kazu@codesourcery.com>2001-01-25 20:12:49 +0000
commit10bfd974d4f11805bbfed8be5696591de45066dd (patch)
tree093c2bdc5918c28e34bd7d68f880f10fa667bd94 /bfd
parentefd59e3f325dfcf4a797d830abf78eac3cd4a78d (diff)
downloadgdb-10bfd974d4f11805bbfed8be5696591de45066dd.zip
gdb-10bfd974d4f11805bbfed8be5696591de45066dd.tar.gz
gdb-10bfd974d4f11805bbfed8be5696591de45066dd.tar.bz2
2001-01-25 Kazu Hirata <kazu@hxi.com>
* chew.c: Do not output trailing whitespaces in type and functionname. Update copyright.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/doc/ChangeLog5
-rw-r--r--bfd/doc/chew.c31
2 files changed, 23 insertions, 13 deletions
diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog
index e4b6063..57326a9 100644
--- a/bfd/doc/ChangeLog
+++ b/bfd/doc/ChangeLog
@@ -1,3 +1,8 @@
+2001-01-25 Kazu Hirata <kazu@hxi.com>
+
+ * chew.c: Do not output trailing whitespaces in type and
+ functionname. Update copyright.
+
2001-01-24 Kazu Hirata <kazu@hxi.com>
* chew.c: Do not output a trailing whitespace.
diff --git a/bfd/doc/chew.c b/bfd/doc/chew.c
index 1511614..7b98ccf 100644
--- a/bfd/doc/chew.c
+++ b/bfd/doc/chew.c
@@ -1,5 +1,5 @@
/* chew
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1998, 2000
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1998, 2000, 2001
Free Software Foundation, Inc.
Contributed by steve chamberlain @cygnus
@@ -487,6 +487,7 @@ paramstuff (void)
unsigned int openp;
unsigned int fname;
unsigned int idx;
+ unsigned int len;
string_type out;
init_string (&out);
@@ -513,29 +514,33 @@ paramstuff (void)
fname++;
- for (idx = 0; idx < fname; idx++) /* Output type */
+ /* Output type, omitting trailing whitespace character(s), if
+ any. */
+ for (len = fname; 0 < len; len--)
{
- /* Omit a trailing whitespace. */
- if (idx + 1 == fname && isspace ((unsigned char) at (tos, idx)))
+ if (!isspace ((unsigned char) at (tos, len - 1)))
break;
-
- catchar (&out, at (tos, idx));
}
+ for (idx = 0; idx < len; idx++)
+ catchar (&out, at (tos, idx));
cattext (&out, "\n"); /* Insert a newline between type and fnname */
- for (idx = fname; idx < openp; idx++) /* Output fnname */
+ /* Output function name, omitting trailing whitespace
+ character(s), if any. */
+ for (len = openp; 0 < len; len--)
{
- catchar (&out, at (tos, idx));
+ if (!isspace ((unsigned char) at (tos, len - 1)))
+ break;
}
+ for (idx = fname; idx < len; idx++)
+ catchar (&out, at (tos, idx));
cattext (&out, " PARAMS (");
- while (at (tos, idx) && at (tos, idx) != ';')
- {
- catchar (&out, at (tos, idx));
- idx++;
- }
+ for (idx = openp; at (tos, idx) && at (tos, idx) != ';'; idx++)
+ catchar (&out, at (tos, idx));
+
cattext (&out, ");\n\n");
}
overwrite_string (tos, &out);