[pacman-dev] [PATCH] Fix list_display on non-ttys and other output fixes
Dan McGee
dpmcgee at gmail.com
Wed Jun 15 10:09:17 EDT 2011
On Wed, Jun 15, 2011 at 4:03 AM, Jakob Gruber <jakob.gruber at gmail.com> wrote:
> On 06/14/2011 12:11 AM, Dan McGee wrote:
>>
>> + const char *str = alpm_list_getdata(list);
>> + printf("%s", str);
>> + cols += string_length(str);
>> + for(i = alpm_list_next(list), cols = len; i; i =
>> alpm_list_next(i)) {
>
> cols is assigned and then overwritten in the next line?
Definite oversight here; removing the assignment from the for() should
take care of any issue here, it appears.
>> + const char *str = alpm_list_getdata(i);
>> int s = string_length(str);
>> - if(cols + s + 2>= maxcols) {
>> + /* wrap only if we have enough usable column space
>> */
>> + if(maxcols> len&& cols + s + 2>= maxcols) {
>> int j;
>> cols = len;
>> printf("\n");
>
>
>
More information about the pacman-dev
mailing list