[pacman-dev] [PATCH] Fix list_display on non-ttys and other output fixes

Jakob Gruber jakob.gruber at gmail.com
Wed Jun 15 05:03:07 EDT 2011


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?

> +			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