From: David Lamparter Date: Fri, 14 Jul 2017 11:15:55 +0000 (+0200) Subject: Merge remote-tracking branch 'frr/master' into newline-redux X-Git-Tag: reindent-master-before~7^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=84a98309def99b23c86de42ea8228d9191b65772;p=matthieu%2Ffrr.git Merge remote-tracking branch 'frr/master' into newline-redux Signed-off-by: David Lamparter --- 84a98309def99b23c86de42ea8228d9191b65772 diff --cc bgpd/bgp_route.c index 6fd959e304,6b38ba6856..c2694b82bb --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@@ -8063,9 -8064,10 +8063,10 @@@ bgp_show (struct vty *vty, struct bgp * if (bgp == NULL) { if (!use_json) - vty_outln (vty, "No BGP process is configured"); + vty_out (vty, "No BGP process is configured\n"); return CMD_WARNING; } + /* use MPLS and ENCAP specific shows until they are merged */ if (safi == SAFI_MPLS_VPN) { @@@ -9172,14 -9182,21 +9180,21 @@@ bgp_table_stats (struct vty *vty, struc { struct bgp_table_stats ts; unsigned int i; - + if (!bgp->rib[afi][safi]) { - vty_outln (vty, "%% No RIB exist's for the AFI(%d)/SAFI(%d)", + vty_out (vty, "%% No RIB exist's for the AFI(%d)/SAFI(%d)\n", afi, safi); return CMD_WARNING; } - + - vty_outln (vty, "BGP %s RIB statistics%s", - afi_safi_print (afi, safi), VTYNL); ++ vty_out (vty, "BGP %s RIB statistics\n", ++ afi_safi_print (afi, safi)); + + /* labeled-unicast routes live in the unicast table */ + if (safi == SAFI_LABELED_UNICAST) + safi = SAFI_UNICAST; + memset (&ts, 0, sizeof (ts)); ts.table = bgp->rib[afi][safi]; thread_execute (bm->master, bgp_table_stats_walker, &ts, 0); diff --cc lib/vty.c index 80714597ac,2c25bd2fc3..9439e38834 --- a/lib/vty.c +++ b/lib/vty.c @@@ -1116,17 -1134,13 +1116,13 @@@ vty_describe_command (struct vty *vty vector varcomps = vector_init (VECTOR_MIN_SIZE); cmd_variable_complete (token, ref, varcomps); - if (vector_active(varcomps) > 0) + if (vector_active (varcomps) > 0) { - vty_out(vty, " "); - for (size_t j = 0; j < vector_active (varcomps); j++) - { - char *item = vector_slot (varcomps, j); - vty_out(vty, " %s", item); - XFREE(MTYPE_COMPLETION, item); - } - vty_out (vty, "\n"); - char *ac = cmd_variable_comp2str(varcomps, vty->width, VTYNL); - vty_outln(vty, "%s", ac); ++ char *ac = cmd_variable_comp2str(varcomps, vty->width, "\n"); ++ vty_out(vty, "%s\n", ac); + XFREE(MTYPE_TMP, ac); } + vector_free(varcomps); } #if 0