summaryrefslogtreecommitdiff
path: root/ext/ftp/ftp.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2005-03-10 23:37:45 +0000
committerIlia Alshanetsky <iliaa@php.net>2005-03-10 23:37:45 +0000
commitff80321587a3cfb0ee646ef2e952c08d00ca01a7 (patch)
treea1aa9aace38c86c4e9d0d05053ac4bd2bb2fa6e3 /ext/ftp/ftp.c
parente6034763ca9ab559e269a421a664ecac7ae4a769 (diff)
downloadphp-git-ff80321587a3cfb0ee646ef2e952c08d00ca01a7.tar.gz
Final set of fixes for bug #27633.
# Many thanks to Edin for helpind analyze and resolve this bug.
Diffstat (limited to 'ext/ftp/ftp.c')
-rw-r--r--ext/ftp/ftp.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index 01bbf3905b..8a229a17c6 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -846,25 +846,8 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
* Everything Else \n
*/
#ifdef PHP_WIN32
- while ((s = strpbrk(ptr, "\r\n")) && (s < e)) {
- php_stream_write(outstream, ptr, (s - ptr));
- php_stream_write(outstream, "\r\n", sizeof("\r\n")-1);
-
- if (*s == '\r') {
- s++;
- }
- /* for some reason some servers prefix a \r before a \n,
- * resulting in a \r\r\n in the buffer when
- * the remote file already has windoze style line endings.
- */
- if (*s == '\r') {
- s++;
- }
- if (*s == '\n') {
- s++;
- }
- ptr = s;
- }
+ php_stream_write(outstream, ptr, (e - ptr));
+ ptr = e;
#else
while (e > ptr && (s = memchr(ptr, '\r', (e - ptr)))) {
php_stream_write(outstream, ptr, (s - ptr));