com php-src: - Fix trailling newline handling: phpdbg_list. c
| From: | Bob Weinand | Date: | Sun, 17 Nov 2013 12:23:50 +0000 |
| Subject: | com php-src: - Fix trailling newline handling: phpdbg_list. c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74893@lists.php.net to get a copy of this message | ||
Commit: 180bb579bfcae9e6a42c1c738ea66bdbb6463d19
Author: Felipe Pena <felipensp@gmail.com> Sun, 17 Nov 2013 10:23:50 -0200
Parents: f51a08b6d665fd7635130ac16dcb9af1aa310bba
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=180bb579bfcae9e6a42c1c738ea66bdbb6463d19
Log:
- Fix trailling newline handling
Changed paths:
M phpdbg_list.c
Diff:
diff --git a/phpdbg_list.c b/phpdbg_list.c
index 0c61bc4..35de246 100644
--- a/phpdbg_list.c
+++ b/phpdbg_list.c
@@ -179,11 +179,15 @@ void phpdbg_list_file(const char *filename, long count, long offset, int
highlig
end_pos = mem + st.st_size;
#endif
while (1) {
+ if (pos == end_pos) {
+ break;
+ }
+
pos = memchr(last_pos, '\n', end_pos - last_pos);
if (!pos) {
/* No more line breaks */
- break;
+ pos = end_pos;
}
++line;