xbps-query(8): do not truncate output if stdout is not a tty.
This commit is contained in:
@ -72,7 +72,7 @@ list_pkgs_in_dict(struct xbps_handle *xhp _unused,
|
||||
|
||||
tmp[i] = '\0';
|
||||
len = strlen(tmp) + strlen(short_desc) + 2;
|
||||
if (len > lpc->maxcols) {
|
||||
if (lpc->maxcols && len > lpc->maxcols) {
|
||||
out = malloc(lpc->maxcols+1);
|
||||
assert(out);
|
||||
snprintf(out, lpc->maxcols - 3,
|
||||
|
@ -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",
|
||||
|
Reference in New Issue
Block a user