Commit d4d819a7 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

imlib.c: feh_draw_info: Only kill a line's last character if it's a newline

feh_draw_info used to unconditionally swallow the last character of a line,
assuming that it must be a newline. However, the very last line of a program's
output may not end in a newline, in which case its last output character was
omitted.
parent fee966ab
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -562,7 +562,9 @@ void feh_draw_info(winwidget w)
	}
	else {
		while ((no_lines < 20) && fgets(info_buf, 256, info_pipe)) {
			if (info_buf[strlen(info_buf)-1] == '\n')
				info_buf[strlen(info_buf)-1] = '\0';

			gib_imlib_text_draw(im, fn, NULL, 2, (no_lines*th)+2, info_buf,
					IMLIB_TEXT_TO_RIGHT, 0, 0, 0, 255);
			gib_imlib_text_draw(im, fn, NULL, 1, (no_lines*th)+1, info_buf,