diff --git a/NEWS b/NEWS index f85d4229..15d8de28 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ xbps-0.42 (???): + * xbps-{install,query}: fix alignment in the column output mode + when pkgname is shorter than 4 chars. Fix #71 (https://github.com/voidlinux/xbps/issues/71) + * xbps.d(5): new manual page detailing the configuration settings. * xbps-dgraph(8): added support to generate dependency graphs, repository diff --git a/bin/xbps-install/util.c b/bin/xbps-install/util.c index baaf27fc..e3e2a463 100644 --- a/bin/xbps-install/util.c +++ b/bin/xbps-install/util.c @@ -103,13 +103,17 @@ print_trans_colmode(struct transaction *trans, int cols) pnamelen = find_longest_pkgname(trans); /* header length */ - hdrlen = 4 + pnamelen + 60; + hdrlen = pnamelen + 61; if (cols <= hdrlen) return false; - printf("\nName"); - for (x = 4; x < pnamelen; x++) + printf("\nName "); + if (pnamelen < 5) + pnamelen = 5; + + for (x = 5; x < pnamelen; x++) printf(" "); + printf("Action Version New version Download size\n"); while ((obj = xbps_object_iterator_next(trans->iter)) != NULL) {