summaryrefslogtreecommitdiff
path: root/libiberty/cp-demangle.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-10 17:02:52 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-10 17:02:52 +0000
commit4ef84ecb8d5b6e12918092e5b9d563d4fd72b233 (patch)
tree90c3e3ac2cad752705cfdb425242698390bb7199 /libiberty/cp-demangle.c
parent3e426b86d2ef51d0abcee1ec27167a3d9bfe3037 (diff)
downloadgcc-4ef84ecb8d5b6e12918092e5b9d563d4fd72b233.tar.gz
* cp-demangle.c (d_print_comp) [DEMANGLE_COMPONENT_OPERATOR]:
Omit a trailing space in the operator name. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183072 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/cp-demangle.c')
-rw-r--r--libiberty/cp-demangle.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 2dfd67ceb77..18b84a126e8 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -4357,14 +4357,17 @@ d_print_comp (struct d_print_info *dpi, int options,
case DEMANGLE_COMPONENT_OPERATOR:
{
- char c;
+ const struct demangle_operator_info *op = dc->u.s_operator.op;
+ int len = op->len;
d_append_string (dpi, "operator");
- c = dc->u.s_operator.op->name[0];
- if (IS_LOWER (c))
+ /* Add a space before new/delete. */
+ if (IS_LOWER (op->name[0]))
d_append_char (dpi, ' ');
- d_append_buffer (dpi, dc->u.s_operator.op->name,
- dc->u.s_operator.op->len);
+ /* Omit a trailing space. */
+ if (op->name[len-1] == ' ')
+ --len;
+ d_append_buffer (dpi, op->name, len);
return;
}