summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--main/streams/plain_wrapper.c12
2 files changed, 5 insertions, 8 deletions
diff --git a/NEWS b/NEWS
index 9eaa1b1c58..157d77c262 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ PHP NEWS
Nikita)
. Fixed bug #80037 (Typed property must not be accessed before initialization
when __get() declared). (Nikita)
+ . Fixed bug #80048 (Bug #69100 has not been fixed for Windows). (cmb)
- Calendar:
. Fixed bug #80007 (Potential type confusion in unixtojd() parameter parsing).
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index 8f7774a30e..50ca925dea 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -808,15 +808,11 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void
}
size = GetFileSize(hfile, NULL);
- if (range->length == 0 && range->offset > 0 && range->offset < size) {
- range->length = size - range->offset;
- }
- if (range->length == 0 || range->length > size) {
- range->length = size;
- }
- if (range->offset >= size) {
+ if (range->offset > size) {
range->offset = size;
- range->length = 0;
+ }
+ if (range->length == 0 || range->length > size - range->offset) {
+ range->length = size - range->offset;
}
/* figure out how big a chunk to map to be able to view the part that we need */