From 67e1e0c4c9905e6ceea3f907582687d8b3e7611d Mon Sep 17 00:00:00 2001 From: Moe Jette <jette1@llnl.gov> Date: Mon, 12 Sep 2005 16:43:20 +0000 Subject: [PATCH] show single bgl name as bgl123 not bgl[123x123] --- src/common/hostlist.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/hostlist.c b/src/common/hostlist.c index b2c4da5bde1..9b22f5c2a94 100644 --- a/src/common/hostlist.c +++ b/src/common/hostlist.c @@ -2342,7 +2342,14 @@ size_t hostlist_ranged_string(hostlist_t hl, size_t n, char *buf) _clear_grid(); for (i=0;i<hl->nranges;i++) _set_grid(hl->hr[i]->lo, hl->hr[i]->hi); - if (!_test_box()) { + if ((axis_min_x == axis_max_x) && (axis_min_y == axis_max_y) + && (axis_min_z == axis_max_z)) { + len += snprintf(buf, n, "%s%d%d%d", + hl->hr[0]->prefix, + axis_min_x, axis_min_y, axis_min_z); + if ((len < 0) || (len > n)) + len = n; /* truncated */ + } else if (!_test_box()) { sprintf(buf, "%s[", hl->hr[0]->prefix); len = strlen(hl->hr[0]->prefix) + 1; len += _get_boxes(buf + len, (n-len)); -- GitLab