From: Luis Machado Date: Wed, 6 Jan 2021 12:30:27 +0000 (-0300) Subject: Don't print parenthesis if there are no capability attributes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d27c73d60c50420298683e2bd035d0ec59bb7ed;p=thirdparty%2Fbinutils-gdb.git Don't print parenthesis if there are no capability attributes gdbsupport/ChangeLog: 2021-01-15 Luis Machado capability.cc (capability::to_str): Don't print parenthesis if there are no attributes. --- diff --git a/gdbsupport/capability.cc b/gdbsupport/capability.cc index eb8f6980f78..e75b8f6de7b 100644 --- a/gdbsupport/capability.cc +++ b/gdbsupport/capability.cc @@ -612,7 +612,9 @@ capability::to_str (bool compact) } cap_str += val_str + " [" + perm_str + "," + range_str + "]"; - cap_str += " (" + attr1_str + attr2_str + attr3_str + ")"; + + if (!attr1_str.empty () || !attr2_str.empty () || !attr3_str.empty ()) + cap_str += " (" + attr1_str + attr2_str + attr3_str + ")"; return cap_str; }