aboutsummaryrefslogtreecommitdiff
path: root/libiberty/cp-demangle.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2012-01-10 18:15:34 +0000
committerDJ Delorie <dj@redhat.com>2012-01-10 18:15:34 +0000
commitfbfd63c0a6ed1f8192020ab09b1edc4496aff91a (patch)
tree5c8544b9068b0a9577ad38ca488163e5e2e9882f /libiberty/cp-demangle.c
parent06b9f45fe491c53d07c631916903640f101a3904 (diff)
downloadgdb-fbfd63c0a6ed1f8192020ab09b1edc4496aff91a.zip
gdb-fbfd63c0a6ed1f8192020ab09b1edc4496aff91a.tar.gz
gdb-fbfd63c0a6ed1f8192020ab09b1edc4496aff91a.tar.bz2
merge from gcc
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 2dfd67c..18b84a1 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;
}