mirror of
https://github.com/php/php-src.git
synced 2025-08-19 17:04:47 +02:00
- Fix trailling newline handling
This commit is contained in:
parent
f51a08b6d6
commit
180bb579bf
1 changed files with 5 additions and 1 deletions
|
@ -179,11 +179,15 @@ void phpdbg_list_file(const char *filename, long count, long offset, int highlig
|
||||||
end_pos = mem + st.st_size;
|
end_pos = mem + st.st_size;
|
||||||
#endif
|
#endif
|
||||||
while (1) {
|
while (1) {
|
||||||
|
if (pos == end_pos) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
pos = memchr(last_pos, '\n', end_pos - last_pos);
|
pos = memchr(last_pos, '\n', end_pos - last_pos);
|
||||||
|
|
||||||
if (!pos) {
|
if (!pos) {
|
||||||
/* No more line breaks */
|
/* No more line breaks */
|
||||||
break;
|
pos = end_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
++line;
|
++line;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue