index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2009-12-13 23:12:44 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2009-12-13 23:12:44 -0600 |
commit | e612eb6ba227104761b9c6fafe375c74267bba09 (patch) | |
tree | ac765b3eb1a594e0625427dd363bbf5e210dfbac /src | |
parent | 926dfe5827d13a38f02efb2da1d9ceab38e9fc16 (diff) |
-rw-r--r-- | src/pacman/util.c | 10 |
diff --git a/src/pacman/util.c b/src/pacman/util.c index 115b3673..14a0f6cd 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -446,18 +446,20 @@ void list_display(const char *title, const alpm_list_t *list) for(i = list, cols = len; i; i = alpm_list_next(i)) { char *str = alpm_list_getdata(i); int s = string_length(str); - /* two additional spaces are added to the length */ - s += 2; int maxcols = getcols(); - if(s + cols > maxcols && maxcols > 0) { + if(maxcols > 0 && (cols + s + 2) >= maxcols) { int j; cols = len; printf("\n"); for (j = 1; j <= len; j++) { printf(" "); } + } else if (cols != len) { + /* 2 spaces are added if this is not the first element on a line. */ + printf(" "); + cols += 2; } - printf("%s ", str); + printf("%s", str); cols += s; } printf("\n"); |