xbps-query(8): do not truncate output if stdout is not a tty.

This commit is contained in:
Juan RP
2015-04-15 18:40:34 +02:00
parent 2bead22e56
commit bc97851fdb
4 changed files with 16 additions and 6 deletions

View File

@@ -80,7 +80,7 @@ print_results(struct xbps_handle *xhp, struct search_data *sd)
inststr = "[-]";
len = strlen(inststr) + strlen(tmp) + strlen(desc) + 3;
if ((int)len > sd->maxcols) {
if (sd->maxcols && (int)len > sd->maxcols) {
out = malloc(sd->maxcols+1);
assert(out);
snprintf(out, sd->maxcols-3, "%s %s %s",