display: when converting tabs, don't go beyond the screen width
This fixes https://savannah.gnu.org/bugs/?51427.master
parent
ecc7c26641
commit
4f3249de56
|
@ -1902,7 +1902,7 @@ char *display_string(const char *buf, size_t column, size_t span, bool isdata)
|
||||||
converted[index++] = ' ';
|
converted[index++] = ' ';
|
||||||
column++;
|
column++;
|
||||||
/* Fill the tab up with the required number of spaces. */
|
/* Fill the tab up with the required number of spaces. */
|
||||||
while (column % tabsize != 0) {
|
while (column % tabsize != 0 && column < beyond) {
|
||||||
converted[index++] = ' ';
|
converted[index++] = ' ';
|
||||||
column++;
|
column++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue