diff options
author | DJ Delorie <dj@redhat.com> | 2012-01-10 18:15:34 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2012-01-10 18:15:34 +0000 |
commit | fbfd63c0a6ed1f8192020ab09b1edc4496aff91a (patch) | |
tree | 5c8544b9068b0a9577ad38ca488163e5e2e9882f /libiberty/cp-demangle.c | |
parent | gdb/ (diff) | |
download | binutils-gdb-fbfd63c0a6ed1f8192020ab09b1edc4496aff91a.tar.gz binutils-gdb-fbfd63c0a6ed1f8192020ab09b1edc4496aff91a.tar.bz2 binutils-gdb-fbfd63c0a6ed1f8192020ab09b1edc4496aff91a.zip |
merge from gcc
Diffstat (limited to 'libiberty/cp-demangle.c')
-rw-r--r-- | libiberty/cp-demangle.c | 13 |
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; } |