OSSP CVS Repository

ossp - Check-in [2648]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 2648
Date: 2002-Oct-22 17:09:44 (local)
2002-Oct-22 15:09:44 (UTC)
User:mlelstv
Branch:
Comment: prepend used wrong macros (cut&paste error) traverse_next didn't compute step correctly and didn't clear skip from initial seek when moving to next/previous chunk

PR: Submitted by: Reviewed by: Approved by: Obtained from:

Tickets:
Inspections:
Files:
ossp-pkg/sio/al.c      1.27 -> 1.28     6 inserted, 5 deleted

ossp-pkg/sio/al.c 1.27 -> 1.28

--- al.c 2002/10/18 14:12:11     1.27
+++ al.c 2002/10/22 15:09:44     1.28
@@ -533,9 +533,9 @@
             step = res;
 
         src -= step;
-        AL_RESIZE(al, cur, step);
+        AL_PRESIZE(al, cur, step);
         n   -= step;
-        res = AL_CHUNK_RESERVE(cur);
+        res = AL_CHUNK_PRESERVE(cur);
 
         dst = AL_CHUNK_PTR(cur, 0);
         memcpy(dst, src, step);
@@ -836,9 +836,8 @@
     if (tx->cur == NULL)   /* premature EOF */
         return AL_ERR_EOF;
 
-    step = AL_CHUNK_LEN(tx->cur);
-    if (step > tx->togo)
-        step = tx->togo;
+    /* compute number of bytes to process */
+    step = AL_CHUNK_SPAN(tx->cur, tx->skip, tx->togo);
 
     /*
      * synthetic chunk which is NOT maintained in usecount
@@ -855,10 +854,12 @@
         case AL_FORWARD:
             tx->cur   = NEXT(tx->cur,chunks);
             tx->togo -= step;
+            tx->skip  = 0;
             break;
         case AL_BACKWARD:
             tx->cur   = PREV(tx->cur,chunks);
             tx->togo -= step;
+            tx->skip  = 0;
             break;
     }
 

CVSTrac 2.0.1