projects
/
rrq
/
fusefile.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c382243
)
fixup of ocerlay_merge
author
Ralph Ronnquist
<ralph.ronnquist@gmail.com>
Wed, 10 Aug 2022 15:39:54 +0000
(
01:39
+1000)
committer
Ralph Ronnquist
<ralph.ronnquist@gmail.com>
Wed, 10 Aug 2022 15:39:54 +0000
(
01:39
+1000)
fusefile.c
patch
|
blob
|
history
diff --git
a/fusefile.c
b/fusefile.c
index f74632a5356b0040f58b4118083bca91a5b9cbc6..30ec7fa284c7ce1f330daaede1de2fb1835ee9b5 100644
(file)
--- a/
fusefile.c
+++ b/
fusefile.c
@@
-416,14
+416,17
@@
static int overlay_merge(char *buf,off_t off,size_t size) {
p = 0;
}
for ( ; p < overlay.count && BEG(p) < off+size; p++ ) {
+ if ( END(p) < off ) {
+ continue;
+ }
size_t delta = FRAG(p)->size;
- if ( BEG(p) > off ) {
+ if ( BEG(p) < off ) {
+ delta -= off - BEG(p);
+ } else {
size_t skip = BEG(p) - off;
off += skip;
size -= skip;
buf += skip;
- } else {
- delta = off - BEG(p);
}
if ( delta > size ) {
delta = size;