--- less-394/line.c.search 2005-12-03 21:20:32.000000000 +0100 +++ less-394/line.c 2006-02-15 11:23:25.308694376 +0100 @@ -1125,6 +1125,14 @@ break; } } + if (c == '\0') + { + /* + * Pretend the line ended here + */ + new_pos = ch_tell(); + break; + } linebuf[n++] = c; c = ch_forw_get(); } @@ -1198,6 +1206,14 @@ *to = *fm; n = size_linebuf - old_size_linebuf; } + if (c == '\0') + { + /* + * Pretend the line ended here + */ + new_pos = ch_tell() + 1; + break; + } linebuf[--n] = c; } if (linep != NULL)